__construct() public method

Accepted parameters:
public __construct ( array $params )
$params array {
Ejemplo n.º 1
0
 public function __construct($attributes = [])
 {
     parent::__construct(['attributes' => $attributes, 'fields' => ['id', 'game_user_id', 'field', 'multiplier', 'round'], 'belongsTo' => ['game_user' => ['class' => 'GameUser', 'foreignKey' => 'game_user_id', 'referencedColumn' => 'id']]]);
 }
Ejemplo n.º 2
0
 public function __construct($attributes = [])
 {
     parent::__construct(['attributes' => $attributes, 'fields' => ['id', 'game_id', 'user_id', 'score' => 0, 'ordinal'], 'belongsTo' => ['user' => ['class' => 'User', 'foreignKey' => 'user_id', 'referencedColumn' => 'id'], 'game' => ['class' => 'Game', 'foreignKey' => 'game_id', 'referencedColumn' => 'id']], 'hasOne' => ['winner_game' => ['class' => 'Game', 'foreignKey' => 'winner_game_user_id']]]);
 }
Ejemplo n.º 3
0
 public function __construct($attributes = array())
 {
     parent::__construct(array('hasMany' => array('products' => array('class' => 'Test\\Product', 'foreignKey' => 'id_category'), 'products_starting_with_b' => array('class' => 'Test\\Product', 'foreignKey' => 'id_category', 'conditions' => "products.name LIKE 'b%'"), 'products_ending_with_b_or_y' => array('class' => 'Test\\Product', 'foreignKey' => 'id_category', 'conditions' => function () {
         return WhereClause::create("products.name LIKE ? OR products.name LIKE ?", array('%b', '%y'));
     }), 'products_name_bob' => array('class' => 'Test\\Product', 'foreignKey' => 'id_category', 'conditions' => array("products.name" => "bob")), 'products_ordered_by_name' => array('class' => 'Test\\Product', 'foreignKey' => 'id_category', 'order' => array("products.name ASC"))), 'hasOne' => array('product_named_billy' => array('class' => 'Test\\Product', 'foreignKey' => 'id_category', 'conditions' => "products.name = 'billy'")), 'belongsTo' => array('parent' => array('class' => 'Test\\Category', 'foreignKey' => 'id_parent', 'referencedColumn' => 'id')), 'attributes' => $attributes, 'fields' => $this->_fields));
 }
Ejemplo n.º 4
0
 function __construct($attributes = array())
 {
     parent::__construct(array('attributes' => $attributes, 'fields' => array('login', 'password')));
 }
Ejemplo n.º 5
0
 public function __construct($attributes = array())
 {
     parent::__construct(array('table' => 'orders', 'sequence' => 'orders_id_order_seq', 'primaryKey' => 'id_order', 'attributes' => $attributes, 'fields' => $this->_fields));
 }
Ejemplo n.º 6
0
 public function __construct($attributes = array())
 {
     parent::__construct(array('table' => 'products', 'attributes' => $attributes, 'fields' => array('description' => self::$defaultDescription, 'name' => function () {
         return ProductWithDefaults::$defaultName;
     }, 'id_category', 'id_manufacturer', 'sale')));
 }
Ejemplo n.º 7
0
 public function __construct($attributes = array())
 {
     parent::__construct(array('table' => 'products', 'primaryKey' => 'id', 'fields' => array('name'), 'sequence' => '', 'attributes' => $attributes));
 }
Ejemplo n.º 8
0
 public function __construct($attributes = [])
 {
     parent::__construct(['attributes' => $attributes, 'fields' => ['id', 'login', 'password'], 'hasMany' => ['game_users' => ['class' => 'GameUser', 'foreignKey' => 'user_id']]]);
 }
Ejemplo n.º 9
0
 public function __construct($attributes = [])
 {
     parent::__construct(['attributes' => $attributes, 'fields' => ['id', 'current_game_user_id', 'round' => 1, 'finished' => false, 'winner_game_user_id', 'type', 'started_at' => Clock::nowAsString()], 'belongsTo' => ['current_game_user' => ['class' => 'GameUser', 'foreignKey' => 'current_game_user_id', 'referencedColumn' => 'id'], 'winner_game_user' => ['class' => 'GameUser', 'foreignKey' => 'winner_game_user_id', 'referencedColumn' => 'id']], 'hasMany' => ['game_users' => ['class' => 'GameUser', 'foreignKey' => 'game_id', 'referencedColumn' => 'id']]]);
 }
Ejemplo n.º 10
0
 public function __construct(array $params)
 {
     parent::__construct($params);
 }
Ejemplo n.º 11
0
 public function __construct($attributes = array())
 {
     parent::__construct(array('table' => 'products', 'primaryKey' => '', 'attributes' => $attributes, 'fields' => $this->_fields));
 }
Ejemplo n.º 12
0
 public function __construct($attributes = array())
 {
     parent::__construct(array('table' => 'order_products', 'sequence' => '', 'primaryKey' => '', 'attributes' => $attributes, 'belongsTo' => array('product' => array('class' => 'Test\\Product', 'foreignKey' => 'id_product'), 'order' => array('class' => 'Test\\Order', 'foreignKey' => 'id_order')), 'fields' => $this->_fields));
 }
Ejemplo n.º 13
0
 public function __construct($attributes = array(), $beforeSaveCallback = null, $afterSaveCallback = null)
 {
     parent::__construct(array('beforeSave' => $beforeSaveCallback, 'afterSave' => $afterSaveCallback, 'table' => 'products', 'primaryKey' => 'id', 'attributes' => $attributes, 'fields' => array('name')));
 }
Ejemplo n.º 14
0
 public function __construct($attributes = [])
 {
     parent::__construct(['attributes' => $attributes, 'fields' => ['id', 'name', 'params', 'created_at' => Clock::nowAsString()]]);
 }
Ejemplo n.º 15
0
 public function __construct($attributes = array())
 {
     parent::__construct(array('attributes' => $attributes, 'belongsTo' => array('manufacturer' => array('class' => 'Test\\Manufacturer', 'foreignKey' => 'id_manufacturer'), 'category' => array('class' => 'Test\\Category', 'foreignKey' => 'id_category'), 'categoryWithNameByDescription' => array('class' => 'Test\\Category', 'foreignKey' => 'description', 'referencedColumn' => 'name')), 'hasOne' => array('orderProduct' => array('class' => 'Test\\OrderProduct', 'foreignKey' => 'id_product')), 'fields' => $this->_fields));
 }
Ejemplo n.º 16
0
 public function __construct()
 {
     parent::__construct(array('fields' => array('name')));
 }
Ejemplo n.º 17
0
 public function __construct($attributes = array())
 {
     parent::__construct(array('hasMany' => array('products' => array('class' => 'Test\\Product', 'foreignKey' => 'id_manufacturer')), 'attributes' => $attributes, 'fields' => $this->_fields));
 }