_getImagesCountSelect() . ')'); $columns['visibleImageCount'] = new Zend_Db_Expr('(' . $this->_getVisibleImagesCountSelect() . ')'); return $columns; } protected function _getFromDbColumns() { $columns = parent::_getFromColumns(); $columns['visibleImageCount'] = new \Zend_Db_Expr('(' . $this->_getVisibleImagesCountSelect() . ')'); return $columns; } protected function _getImages() { $select = $this->_db->select(); $select->from($this->_getPair('GalleryImage'), ['image']); $select->where('`galleryId` = ?', $this->getPrimaryKey(), Qs_Db::INT_TYPE); return $this->_db->fetchCol($select); } protected function _deleteDependency() { $this->_deleteImages(); return $this; } protected function _deleteImages() { $this->_dependedFiles = array_merge($this->_dependedFiles, $this->_getImages()); return $this; } }