diff --git a/application/modules/default/models/DbTable/ProjectClone.php b/application/modules/default/models/DbTable/ProjectClone.php index 43ce2549c..d3d3cb408 100755 --- a/application/modules/default/models/DbTable/ProjectClone.php +++ b/application/modules/default/models/DbTable/ProjectClone.php @@ -1,113 +1,114 @@ . **/ class Default_Model_DbTable_ProjectClone extends Local_Model_Table { protected $_name = "project_clone"; protected $_keyColumnsForRow = array('project_clone_id'); protected $_key = 'project_clone_id'; protected $_defaultValues = array( 'project_clone_id' => null, 'project_id' => null, 'project_id_parent' => null, 'external_link' => null, 'member_id' => null, 'text' => null, 'is_deleted' => null, 'is_valid' => null, + 'project_clone_type' => null, 'created_at' => null, 'changed_at' => null, 'deleted_at' => null ); public function setDelete($project_clone_id) { $updateValues = array( 'is_deleted' => 1, ); $this->update($updateValues, 'project_clone_id=' . $project_clone_id); } public function setValid($project_clone_id) { $updateValues = array( 'is_valid' => 1, ); $this->update($updateValues, 'project_clone_id=' . $project_clone_id); } /** * @param array $data * * @return Zend_Db_Table_Rowset_Abstract */ protected function generateRowSet($data) { $classRowSet = $this->getRowsetClass(); return new $classRowSet(array( 'table' => $this, 'rowClass' => $this->getRowClass(), 'stored' => true, 'data' => $data )); } public function delete($where) { $where = parent::_whereExpr($where); /** * Build the DELETE statement */ $sql = "UPDATE " . parent::getAdapter()->quoteIdentifier($this->_name, true) . " SET `is_deleted` = 1 " . (($where) ? " WHERE $where" : ''); /** * Execute the statement and return the number of affected rows */ $stmt = parent::getAdapter()->query($sql); $result = $stmt->rowCount(); return $result; } public function listAll($startIndex, $pageSize, $sorting) { $select = $this->select()->order($sorting)->limit($pageSize, $startIndex); $rows = $this->fetchAll($select)->toArray(); $select = $this->select()->where('is_deleted = 0'); $count = $this->fetchAll($select)->count(); if (empty($rows)) { return array('rows' => array(), 'totalCount' => 0); } return array('rows' => $rows, 'totalCount' => $count); } } \ No newline at end of file