Ejemplo n.º 1
0
 /**
  * Construct mixin.
  * @param App $app Association application.
  * @param ActiveModel $model Associated model.
  * @param array $options Associative array of options for mixin.
  */
 public final function __construct(App $app, ActiveModel $model, $options = array())
 {
     parent::__construct($app);
     $this->model = $model;
     $this->options = array_merge($this->options, $options);
     $this->init();
 }
Ejemplo n.º 2
0
 /**
  * Get a model instance or a helper instance, in that order.
  * @param string $property Name of model or helper (without 'Helper'-suffix).
  * @return Model|Helper|void Model object or helper object.
  */
 public function __get($property)
 {
     if (isset($this->modelObjects[$property])) {
         return $this->modelObjects[$property];
     }
     if (isset($this->helperObjects[$property])) {
         return $this->helperObjects[$property];
     }
     return parent::__get($property);
 }
Ejemplo n.º 3
0
 /**
  * Construct database.
  * @param DatabaseSchema $schema Database schema.
  * @param array $options Associative array of options for driver.
  */
 public final function __construct(DatabaseSchema $schema, $options = array())
 {
     parent::__construct();
     $this->schema = $schema;
     $this->init($options);
     $this->migrationAdapter = $this->getMigrationAdapter();
     $this->tableNames = $this->getTables();
     foreach ($this->tableNames as $table) {
         $this->tables[$table] = $this->getTable($table);
     }
 }
Ejemplo n.º 4
0
 /**
  * Construct build script.
  * @param App $app Application.
  * @param string $path Script path.
  */
 public function __construct(App $app, $path)
 {
     parent::__construct($app);
     require $path;
 }
Ejemplo n.º 5
0
 /**
  * Get an associated model, helper or data-value (in that order).
  * @param string $name Name of model/helper or key for data-value.
  * @return Model|Helper|mixed Associated value.
  */
 public function __get($name)
 {
     if (isset($this->modelObjects[$name])) {
         return $this->modelObjects[$name];
     }
     if (isset($this->helperObjects[$name])) {
         return $this->helperObjects[$name];
     }
     if (array_key_exists($name, $this->parameterValues)) {
         return $this->parameterValues[$name];
     }
     return parent::__get($name);
 }
Ejemplo n.º 6
0
 /**
  * {@inheritdoc}
  */
 public function __isset($property)
 {
     switch ($property) {
         case 'dispatchers':
         case 'routes':
         case 'root':
         case 'error':
             return isset($this->{$property});
         case 'route':
             return isset($this->selection);
     }
     return parent::__isset($property);
 }
Ejemplo n.º 7
0
 /**
  * Get an associated model, helper or data-value (in that order).
  * @param string $name Name of model/helper or key for data-value.
  * @return Model|Helper|mixed Associated value.
  */
 public function __get($name)
 {
     if (isset($this->modelObjects[$name])) {
         return $this->modelObjects[$name];
     }
     // TODO: remove
     if (isset($this->view->data->{$name})) {
         return $this->view->data->{$name};
     }
     return parent::__get($name);
 }
Ejemplo n.º 8
0
 /**
  * Construct module.
  * @param App $app Associated application.
  * @param array $options Associative array of options for module.
  * @param AuthHelper $Auth The authentication and authorization helper.
  */
 public final function __construct(App $app, $options = array(), AuthHelper $Auth)
 {
     parent::__construct($app);
     $this->options = array_merge($this->options, $options);
     $this->Auth = $Auth;
 }
Ejemplo n.º 9
0
 /**
  * Construct module.
  * @param App $app Associated application.
  * @param array $options Associative array of options for module.
  */
 public final function __construct(App $app, $options = array())
 {
     parent::__construct($app);
     $this->options = array_merge($this->options, $options);
 }
Ejemplo n.º 10
0
 /**
  * {@inheritdoc}
  */
 public function __call($method, $args)
 {
     switch ($method) {
         case 'and':
             return call_user_func_array(array(new SelectionBuilder($this), 'andWhere'), $args);
         case 'or':
             return call_user_func_array(array(new SelectionBuilder($this), 'orWhere'), $args);
     }
     return parent::__call($method, $args);
 }