Example #1
0
 public function listAction()
 {
     $this->view->headTitle('Errors list');
     $errorCategory = RM_Error_Category::getById($this->_getParam('idLog'));
     RM_View_Top::getInstance()->getBreadcrumbs()->add($errorCategory->getName() . ' errors', array(), 'admin-error-list');
     $order = new RM_Query_Order();
     $order->add('errorStatus', RM_Query_Order::ASC);
     $order->add('idLogRow', RM_Query_Order::DESC);
     $conditions = new RM_Query_Where();
     $conditions->add('idLog', RM_Query_Where::EXACTLY, $errorCategory->getId());
     $limit = new RM_Query_Limits(10);
     $limit->setPage($this->view->page);
     $this->view->errors = RM_Error::getList($order, $conditions, $limit);
 }
Example #2
0
 public function setTimeOverlapsWith(MedOptima_DateTime $fromDateTime, MedOptima_DateTime $toDateTime)
 {
     $from = $fromDateTime->getTimestamp();
     $to = $toDateTime->getTimestamp();
     $firstOr = new RM_Query_Where();
     $firstOr->add('finalVisitTime', '<=', $from)->add('visitEndTime', '>', $from);
     $secondOr = new RM_Query_Where();
     $secondOr->add('finalVisitTime', '<', $to)->add('visitEndTime', '>', $to);
     $thirdOr = new RM_Query_Where();
     $thirdOr->add('finalVisitTime', '>=', $from)->add('finalVisitTime', '<', $to);
     $fourthOr = new RM_Query_Where();
     $fourthOr->add('visitEndTime', '>', $from)->add('visitEndTime', '<', $to);
     $where = new RM_Query_Where();
     $where->addSubOr($firstOr)->addSubOr($secondOr)->addSubOr($thirdOr)->addSubOr($fourthOr);
     $this->_getWhere()->addSub($where);
 }
Example #3
0
 /**
  * @static
  * @param RM_User_Profile $profile
  * @return Application_Model_User_Account[]
  */
 public static function getConnectedAccounts(RM_User_Profile $profile)
 {
     $where = new RM_Query_Where();
     $where->add('idUser', RM_Query_Where::EXACTLY, $profile->getId());
     return static::getList($where);
 }
Example #4
0
 public function previous(Application_Model_Page $page)
 {
     $subWhere = new RM_Query_Where();
     $subWhere->add('contentPages.addDate', RM_Query_Where::EXACTLY, $page->getAddDate()->getDate())->add('contentPages.idPage', RM_Query_Where::MORE, $page->getId());
     $this->_getWhere()->add('contentPages.addDate', RM_Query_Where::MORE, $page->getAddDate()->getDate())->addSubOr($subWhere);
 }
Example #5
0
 public function getAccounts()
 {
     $where = new RM_Query_Where();
     $where->add('idUser', RM_Query_Where::EXACTLY, $this->getId());
     return Application_Model_User_Account::getList($where, new RM_Query_Limits(2));
 }
Example #6
0
 public static function dropSubscriptionCode($idSubscription)
 {
     $idSubscription = (int) $idSubscription;
     $conditions = new RM_Query_Where();
     $conditions->add('idSubscription', RM_Query_Where::EXACTLY, $idSubscription);
     foreach (self::getList() as $code) {
         /* @var Application_Model_Subscription_Code $code */
         $code->remove();
     }
 }