Пример #1
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');
 }
Пример #2
0
    /**
     *	Constructor
     *
     *	@param		devDepth	int		Depth of device dir-struct
     *	@return
     */
    public function __construct($devDepth = NULL)
    {
        $this->fileGuidType = G('ofs-file');
        $this->_dbh = M('Db')->getConnection();
        if ($devDepth !== NULL) {
            $this->_devDepth = $devDepth;
        }
        # FS storage
        $this->_fsStorage = M('Store')->storage(array('table' => 'rm_objectfs_object2fs', 'auto-id-prop' => 'id', 'props' => qw2('id guid_id guid_type'), 'keys' => qw2('id guid-key>guid_id>guidId()+guid_type>guidType()'), 'class' => 'RM_ObjectFs_Filesystem', 'ctorArgs' => array('mapper' => $this), 'cache-prefix' => 'RM_ObjectFs_Filesystem'));
        $props = qw2('fs_id owner_id parent_id name title cdate mdate type access_id access_inherit lib_id properties version
								file_size file_mime_type file_device_id file_device_path
								dir_quota_size dir_quota_quantity dir_quota_level
								symlink_target');
        # File storage: auto-id-prop, guid-prop, guid-type-prop, class
        $this->_fileStorage = M('Store')->storage(array('table' => 'rm_objectfs_file', 'props' => array_merge(array('id'), $props), 'keys' => qw2('id dir-key>+fs_id+parent_id+name'), 'validator' => M('Validator')->create(qw2('owner_id>not_null fs_id>not_empty
									parent_id>not_null type>not_empty name>not_empty')), 'ctorArgs' => array('mapper' => $this, 'guidType' => $this->fileGuidType), 'cache-prefix' => 'RM_ObjectFs_File'));
        $this->fileFactory = new RM_ObjectFs_Factory($this->_fileStorage->mediator(), '', array('mapper' => $this, 'guidType' => $this->fileGuidType));
        $this->_fileStorage->factory(M('Store')->factoryGuid($this->fileFactory, $this->fileGuidType));
    }