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; }
/** * 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'); }
public function getTestList() { return $this->_object->getObjectList(); }
/** * 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')); }
/** * Load list of mail variable objects from DB. * * @return RM_Store_Request_Query */ public function getVariableList() { return $this->_variableStorage->getObjectList(); }
/** * 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()); }
/** * Retrievs list of available filesistems * * @return WL_Store_iRequest */ public function fsList() { return $this->_fsStorage->getObjectList(); }
/** * Return list of mail objects. * * @return RM_Store_Request_Query */ public function getMailList() { return $this->_mailStorage->getObjectList(); }
/** * 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); }
/** * 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); }
public function loadCategoryByName($name) { return iterFirst($this->_storage->getObjectList()->filter('name=?', $name)); }
/** * Create attachment connected with current mail. * * @return RM_MailSend_Attachment */ public function createAttachment() { return $this->_attachStorage->createObject(array("mail_id" => $this->id())); }