/** * @param $key * @param $value */ private function setValue($key, $value) { if ($this->settingsDao->countBy(array("name" => $key)) != 0) { $setting = $this->settingsDao->findOneBy(array("name" => $key)); $setting->value = $value; $this->save($setting); } else { $newSetting = new Entity\Settings(); $newSetting->name = $key; $newSetting->value = $value; $this->save($newSetting); } }
/** * @param array $criteria * @return mixed * * @Secure\Read(allow="guest") */ public function countBy(array $criteria = []) { return $this->dao->countBy($criteria); }
/** * @param array $criteria * @return int */ public function getCount(array $criteria = array()) { return (int) $this->dao->countBy($criteria); }