_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'), array('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->_dependedFields = array_merge($this->_dependedFields, $this->_getImages()); return $this; } }