예제 #1
0
파일: ORM.php 프로젝트: romartyn/cogear
 /**
  * Constructir
  *
  * @param string $table
  * @param string $primary
  */
 public function __construct($table = NULL, $primary = NULL)
 {
     parent::__construct();
     $this->clear();
     $table && ($this->table = $table);
     $this->fields = cogear()->db->getFields($this->table);
     $this->reflection = new ReflectionClass($this);
     $fields = array_keys((array) $this->fields);
     $first = reset($fields);
     $this->primary = $primary ? $primary : $first;
 }
예제 #2
0
파일: Object.php 프로젝트: romartyn/cogear
 /**
  * Constructor
  * 
  * @param string|array $options
  */
 public function __construct($options)
 {
     if (is_string($options)) {
         if (!($config = Config::read(Gear::preparePath($options, 'forms') . EXT))) {
             return error(t('Cannot read form config <b>%s</b>.', '', $options));
         } else {
             $options = $config;
         }
     } else {
         $options = Core_ArrayObject::transform($options);
     }
     parent::__construct($options, Options::SELF);
 }
예제 #3
0
파일: Stack.php 프로젝트: romartyn/cogear
 /**
  * Constructor
  * 
  * @param   string  $name
  */
 public function __construct($name)
 {
     $this->name = $name;
     parent::__construct();
 }