_select) { return $this->_select; } parent::getListSelect(); $this->_select->where('`appFileExists` != "y"'); $this->_select->order('fileName'); return $this->_select; } public function fix(array $selectedPrimary) { $table = $this->_getTable(); foreach ($selectedPrimary as $primaryKey) { $id = $primaryKey['id']; if (($data = $this->_getFromDb($id)) && empty($data['status'])) { if ('n' === $data['appFileExists']) { $status = $this->_deleteUserFile($data['fileName']); $table->update(array('status' => $status), array('id = ?' => $id)); } } } return true; } protected function _deleteUserFile($fileName) { $fullName = WWW_PATH . '/' . Qs_ImageFs::WEB_PATH . '/' . $fileName; if (Qs_ImageFs::delete($fullName)) { $this->_getTable('File')->delete(array('nameFs = ?' => $fileName)); return self::STATUS_OK; } return self::STATUS_FAIL; } }