function findNoSyncInvitations($contact_id, $date_from = null, $limit = 0)
 {
     if (is_null($date_from)) {
         $date_from = '';
     } else {
         $date_from = " AND `start` > '" . $date_from . "'";
     }
     return ProjectEvents::findAll(array('limit' => $limit, 'conditions' => array(' trashed_by_id = 0 AND created_by_id <> ' . $contact_id . ' AND trashed_on =\'' . EMPTY_DATETIME . '\' AND synced = 0 AND contact_id = ' . $contact_id . $date_from), 'join' => array('table' => EventInvitations::instance()->getTableName(), 'jt_field' => 'event_id', 'e_field' => 'object_id')));
 }
Exemplo n.º 2
0
 function findNoSync($contact_id) {
         return ProjectEvents::findAll(array(
             'conditions' => array('`special_id` = "" AND trashed_by_id = 0 AND trashed_on =\''.EMPTY_DATETIME.'\' AND contact_id = '.$contact_id),
             'join' => array(
                     'table' => EventInvitations::instance()->getTableName(),
                     'jt_field' => 'event_id',
                     'e_field' => 'object_id',
             )));
 }
 /**
  * Return manager instance
  *
  * @access protected
  * @param void
  * @return EventInvitations 
  */
 function manager()
 {
     if (!$this->manager instanceof EventInvitations) {
         $this->manager = EventInvitations::instance();
     }
     return $this->manager;
 }
 /**
 * Return manager instance
 *
 * @access protected
 * @param void
 * @return EventInvitations 
 */
 function manager() {
   if(!($this->manager instanceof EventInvitations)) $this->manager = EventInvitations::instance();
   return $this->manager;
 } // manager
Exemplo n.º 5
0
 function getInvitations()
 {
     if (is_null($this->event_invitations)) {
         $this->event_invitations = array();
         $invs = EventInvitations::instance()->findAll(array('conditions' => 'event_id=' . $this->getId()));
         foreach ($invs as $inv) {
             $this->event_invitations[$inv->getContactId()] = $inv;
         }
     }
     return $this->event_invitations;
 }
 /**
 * This function will return paginated result. Result is an array where first element is 
 * array of returned object and second populated pagination object that can be used for 
 * obtaining and rendering pagination data using various helpers.
 * 
 * Items and pagination array vars are indexed with 0 for items and 1 for pagination
 * because you can't use associative indexing with list() construct
 *
 * @access public
 * @param array $arguments Query argumens (@see find()) Limit and offset are ignored!
 * @param integer $items_per_page Number of items per page
 * @param integer $current_page Current page number
 * @return array
 */
 function paginate($arguments = null, $items_per_page = 10, $current_page = 1) {
   if(isset($this) && instance_of($this, 'EventInvitations')) {
     return parent::paginate($arguments, $items_per_page, $current_page);
   } else {
     return EventInvitations::instance()->paginate($arguments, $items_per_page, $current_page);
     //$instance =& EventInvitations::instance();
     //return $instance->paginate($arguments, $items_per_page, $current_page);
   } // if
 } // paginate