Пример #1
0
 public function createGroup($name)
 {
     $object = $this->_storage->loadOrCreateObject('name', $name, array('name' => $name, 'owner_id' => -1));
     M('Permission')->changePermission($object, array(array('grant', me()->getPersonalGroup()->id(), 'READ')));
     $object->save();
     return $object;
 }
Пример #2
0
 /**
  *	Description...
  *
  *	@return void
  **/
 public function availableReportsForGroup(RM_User_Group $obGroup)
 {
     if ($obGroup->alias == 'super-admin') {
         $q = M('Db')->createQuery($this->_tables['list'] . ' rl');
     } else {
         $q = M('Db')->createQuery($this->_tables['access'] . ' ac');
         $q->join('ac', 'left join rm_list rl on rl.id = ac.list_id');
         $q->where('ac.group_id = ?', $obGroup->id());
     }
     return M('Store')->requestQuery($this->_list->factory(), $q)->sort('rl.id', 'ASC');
 }
Пример #3
0
 public function getTestList()
 {
     return $this->_object->getObjectList();
 }
Пример #4
0
 /**
  * Retrievs a list of objects which depends on the given object.
  *
  * @param RM_Memento_Object $object
  * @return RM_Store_iRequest<RM_Memento_Object>
  */
 public function getDependedList(RM_Memento_Object $object)
 {
     $query = M('Db')->createQuery($this->_tables['dep'] . ' dep')->what('s.*')->join('dep', 'LEFT JOIN ' . $this->_tables['store'] . ' s on dep.slave_id=s.id')->where('dep.master_id=?', $object->id());
     return $this->_storage->request($query, qw2('cdate>dep.cdate pos>dep.pos'));
 }
Пример #5
0
 /**
  *	Load list of mail variable objects from DB.
  *
  *	@return		RM_Store_Request_Query
  */
 public function getVariableList()
 {
     return $this->_variableStorage->getObjectList();
 }
Пример #6
0
 /**
  *	Return list of template objects connected with current mail type.
  *
  *	@return		RM_Store_Request_Query
  */
 public function getTemplateList()
 {
     return $this->_templateStorage->getObjectList()->filter("mail_type_id = ?", $this->id());
 }
Пример #7
0
 /**
  * Retrievs list of available filesistems
  *
  * @return WL_Store_iRequest
  */
 public function fsList()
 {
     return $this->_fsStorage->getObjectList();
 }
Пример #8
0
 /**
  *	Return list of mail objects.
  *
  *	@return		RM_Store_Request_Query
  */
 public function getMailList()
 {
     return $this->_mailStorage->getObjectList();
 }
Пример #9
0
 /**
  *	Frees memory used by object and unloads it from memory. Object becomes unusable.
  *
  *	@return		void
  */
 public function free()
 {
     $this->_storage->mediator()->identityMap->delete($this);
     unset($this->_storage, $this->_props, $this->_propsInitial);
 }
Пример #10
0
 /**
  * Returns news list for city
  *
  * @param RM_User_Object $obUser
  * @return RM_News_Object
  */
 public function getNewsListByUser(RM_User_Object $obUser)
 {
     return $this->_news->getObjectList()->filter('is_published = 1 and city_id IN (0, ?)', $obUser->city_id)->sort('posted', 'DESC')->sort('id', 'desc')->limit(10);
 }
Пример #11
0
 public function loadCategoryByName($name)
 {
     return iterFirst($this->_storage->getObjectList()->filter('name=?', $name));
 }
Пример #12
0
 /**
  *	Create attachment connected with current mail.
  *
  *	@return		RM_MailSend_Attachment
  */
 public function createAttachment()
 {
     return $this->_attachStorage->createObject(array("mail_id" => $this->id()));
 }