/** * 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; }
/** * 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); }
/** * Constructor * * @param string $name */ public function __construct($name) { $this->name = $name; parent::__construct(); }