Beispiel #1
0
 /**
  * 通过主键,删除一条记录
  * @param integer $moduleId
  * @return integer
  */
 public function removeByPk($moduleId)
 {
     if (($moduleId = (int) $moduleId) <= 0) {
         return false;
     }
     $tableName = $this->getTblprefix() . TableNames::getModules();
     $sql = $this->getCommandBuilder()->createDelete($tableName, '`module_id` = ?');
     $rowCount = $this->delete($sql, $moduleId);
     return $rowCount;
 }
Beispiel #2
0
 /**
  * 获取“所属模型”验证规则
  * @param mixed $value
  * @return array
  */
 public function getModuleIdRule($value)
 {
     return array('DbExists' => new validator\DbExistsValidator($value, true, Lang::_('SRV_FILTER_POSTS_MODULE_ID_EXISTS'), $this->getDbProxy(), TableNames::getModules(), 'module_id'));
 }