コード例 #1
0
ファイル: Param.class.php プロジェクト: evilgeny/bob
 /**
  *	Description...
  *
  *	@return void
  **/
 public function total()
 {
     if (!$this->_total) {
         $this->_total = $this->_mapper->storage('total')->loadObjectById($this->total_id);
     }
     return $this->_total;
 }
コード例 #2
0
ファイル: Object.class.php プロジェクト: evilgeny/bob
 public function _updateAccessInfo()
 {
     if (!$this->_existsInDb()) {
         return;
     }
     M('Db')->exec("UPDATE " . $this->_mapper->table() . " SET access_id = ?, access_inherit = ? WHERE id = ?", $this->_accessId(), $this->_accessInherit(), $this->id());
     $this->_mapper->storage()->cacheClear($this);
 }
コード例 #3
0
ファイル: Facade.class.php プロジェクト: evilgeny/bob
 /**
  *	Description...
  *
  *	@return void
  **/
 public function sweeper()
 {
     $begin = microtime(true);
     $images = $reports = 0;
     $this->_mapper->_usePermissions(FALSE);
     M('ObjectFs')->srvUsePermissions(0);
     foreach ($this->_mapper->storage('total')->getObjectList() as $object) {
         $result = $object->sweeper();
         if ($result > 0) {
             $images += $result;
         } else {
             $reports -= $result;
         }
     }
     $end = microtime(true);
     M('Trace')->trace('total_report_sweeper', "Report sweeper execution time: " . round($end - $begin, 2) . " sec. Deleted: reports - {$reports}, images - {$images}");
     // так как sweeper запускается ночью, то отправим емейл с уведомлением (в логах трудно отследить, запускался sweeper ночью или нет).
     M("MailSend")->sendAdminMail(array("subject" => "Report sweeper", "body" => "Deleted: reports - {$reports}, images - {$images}\n" . 'execution time: ' . round($end - $begin, 2) . ' sec')) or die("Cannot send mail!");
 }
コード例 #4
0
ファイル: Object.class.php プロジェクト: evilgeny/bob
 /**
  *	Description...
  *
  *	@return void
  **/
 public function valueSelected($value)
 {
     return !isNull(iterFirst($this->_mapper->storage('param')->getObjectList()->filter('total_id=? and varname=?', $this->id(), $value)));
 }