Example #1
0
 public static function manager()
 {
     if (self::$manager) {
         return self::$manager;
     }
     return self::$manager = new Storage_Manager();
 }
Example #2
0
File: Vars.php Project: techart/tao
 public static function db()
 {
     switch (self::$type) {
         case 'orm':
             return WS::env()->orm->vars;
         case 'storage':
             return Storage::manager()->vars;
     }
 }
Example #3
0
 static function initialize()
 {
     $dirs = Storage::manager()->vars()->select(Storage::manager()->vars()->create_query()->eq('vartype', 'dir'));
     array_unshift($dirs, 'Нет');
     CMS_Vars_Storage_Entity::fields(array('vartype' => array('type' => 'select', 'caption' => 'Тип', 'items' => CMS::vars()->types()), 'parent_id' => array('type' => 'tree_select', 'caption' => 'Родитель', 'items' => $dirs), 'code' => array('caption' => 'Идентификатор', 'type' => 'varcode'), 'title' => array('type' => 'input', 'caption' => 'Комментарий', 'tagparms' => array('style' => 'width: 98%')), 'full' => array('type' => 'checkbox', 'caption' => 'Ограниченный доступ')));
 }
Example #4
0
 protected function storage()
 {
     $name = $this->storage_name;
     return Storage::manager()->{$name}();
 }