public function __construct($config = array())
 {
     $this->_tableName = uniqid('dbtest_child');
     $config['table'] = $this->_tableName;
     $this->_referenceMap = array('Parent' => 'parent_id->Kwf_Model_DbWithConnection_ParentExpr_ParentModel');
     parent::__construct($config);
 }
 public function __construct($config = array())
 {
     $this->_tableName = uniqid('dbtest_childsum_foo');
     $config['table'] = $this->_tableName;
     $this->_dependentModels['FooTooBar'] = 'Kwf_Model_DbWithConnection_ExprChildSum_FooToBarModel';
     parent::__construct($config);
 }
 public function __construct($config = array())
 {
     $this->_tableName = uniqid('dbtest');
     $config['table'] = $this->_tableName;
     $config['exprs'] = array('age' => new Kwf_Model_Select_Expr_Date_Age('birth'), 'age2' => new Kwf_Model_Select_Expr_Sql("SELECT expr{age} + expr{age}"));
     parent::__construct($config);
 }
 public function __construct($config = array())
 {
     $this->_tableName = uniqid('dbtest');
     $config['table'] = $this->_tableName;
     $config['exprs'] = array('inrange' => new Kwf_Model_Select_Expr_Area(47.8904081, 13.1834356, 50));
     parent::__construct($config);
 }
 public function __construct($config = array())
 {
     $this->_tableName = uniqid('dbtest_childsum_foo_to_bar');
     $config['table'] = $this->_tableName;
     $this->_referenceMap = array('Foo' => 'foo_id->Kwf_Model_DbWithConnection_ExprChildSum_FooModel', 'Bar' => 'bar_id->Kwf_Model_DbWithConnection_ExprChildSum_BarModel');
     parent::__construct($config);
 }
 public function __construct($config = array())
 {
     $this->_tableName = uniqid('dbtest');
     $config['table'] = $this->_tableName;
     $config['exprs'] = array('foo1' => new Kwf_Model_Select_Expr_Child_GroupConcat('Children', 'id'), 'foo2' => new Kwf_Model_Select_Expr_Child_GroupConcat('Children', 'id', ', '));
     parent::__construct($config);
 }
 public function __construct($config = array())
 {
     $this->_tableName = uniqid('dbtest_parent2');
     $config['table'] = $this->_tableName;
     $this->_dependentModels['Childs'] = 'Kwf_Model_DbWithConnection_ProxyReferences_ChildModel';
     parent::__construct($config);
 }
 public function __construct($config = array())
 {
     $this->_tableName = uniqid('dbtest');
     $config['table'] = $this->_tableName;
     $config['exprs'] = array('position' => new Kwf_Model_Select_Expr_Position('points', array('gr')), 'position_dir' => new Kwf_Model_Select_Expr_Position('points', array('gr'), 'asc'));
     parent::__construct($config);
 }
 public function __construct($config = array())
 {
     $this->_tableName = uniqid('dbtest_parent');
     $config['table'] = $this->_tableName;
     $this->_dependentModels['Childs'] = 'Kwf_Model_DbWithConnection_ParentParentExpr_MiddleModel';
     parent::__construct($config);
 }
 public function __construct($config = array())
 {
     $this->_tableName = uniqid('dbtest');
     $config['table'] = $this->_tableName;
     $config['exprs'] = array('price' => new Kwf_Model_Select_Expr_Integer(100), 'amount' => new Kwf_Model_Select_Expr_Integer('3'), 'total' => new Kwf_Model_Select_Expr_Multiply(array(new Kwf_Model_Select_Expr_Field('price'), new Kwf_Model_Select_Expr_Field('amount'))));
     parent::__construct($config);
 }
 public function __construct($config = array())
 {
     $this->_tableName = uniqid('dbtest');
     $config['table'] = $this->_tableName;
     $config['exprs'] = array('date_year' => new Kwf_Model_Select_Expr_Date_Year('date'), 'date_year_two_digits' => new Kwf_Model_Select_Expr_Date_Year('date', Kwf_Model_Select_Expr_Date_Year::FORMAT_DIGITS_TWO), 'date_format' => new Kwf_Model_Select_Expr_Date_Format('date'), 'date_format2' => new Kwf_Model_Select_Expr_Date_Format('date', 'd.m.Y'));
     parent::__construct($config);
 }
 public function __construct($config = array())
 {
     $this->_tableName = uniqid('dbtest');
     $config['table'] = $this->_tableName;
     $config['exprs'] = array('sum_field_int' => new Kwf_Model_Select_Expr_SumFields(array('value2', 10)), 'sum_int_int' => new Kwf_Model_Select_Expr_SumFields(array(100, 10, 99)), 'sum_field_field' => new Kwf_Model_Select_Expr_SumFields(array('value2', 'id')));
     parent::__construct($config);
 }
 public function __construct($config = array())
 {
     $this->_tableName = 'import' . uniqid();
     $config['table'] = $this->_tableName;
     Kwf_Registry::get('db')->query("CREATE TABLE {$this->_tableName} (\n            `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,\n            `foo` VARCHAR( 200 ) NOT NULL ,\n            `bar` VARCHAR( 200 ) NOT NULL\n        ) ENGINE = INNODB");
     parent::__construct($config);
 }
 public function __construct($config = array())
 {
     $this->_tableName = uniqid('dbtest_child');
     $config['table'] = $this->_tableName;
     $this->_referenceMap = array('Parent' => 'parent_id->Kwf_Model_DbWithConnection_ParentExprDeletedFlag_ParentModel');
     $this->_exprs['parent_foo'] = new Kwf_Model_Select_Expr_Parent('Parent', 'foo');
     parent::__construct($config);
 }
 public function __construct($config = array())
 {
     $this->_tableName = uniqid('dbtest');
     $config['table'] = $this->_tableName;
     $s = new Kwf_Model_Select();
     $config['exprs'] = array('foo1' => new Kwf_Model_Select_Expr_Child_GroupConcat('Children', 'id'), 'foo2' => new Kwf_Model_Select_Expr_Child_GroupConcat('Children', 'id', ', '), 'foo3' => new Kwf_Model_Select_Expr_Child_GroupConcat('Children', 'id', ', ', $s, 'sort_field'), 'foo4' => new Kwf_Model_Select_Expr_Child_GroupConcat('Children', 'id', ', ', $s, array('field' => 'sort_field', 'direction' => 'DESC')));
     parent::__construct($config);
 }
 public function __construct($config = array())
 {
     $this->_tableName = uniqid('dbtest_references_within');
     $config['table'] = $this->_tableName;
     $this->_referenceMap = array('Parent' => 'parent_id->Kwf_Model_DbWithConnection_ReferencesWithinModel_Model');
     $this->_dependentModels['Childs'] = 'Kwf_Model_DbWithConnection_ReferencesWithinModel_Model';
     parent::__construct($config);
 }
 public function __construct($config = array())
 {
     $this->_tableName = 'sibling' . uniqid();
     $config['table'] = $this->_tableName;
     Kwf_Registry::get('db')->query("CREATE TABLE {$this->_tableName} (\n                `master_id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,\n                `baz` VARCHAR( 200 ) NOT NULL\n            ) ENGINE = INNODB");
     Kwf_Registry::get('db')->query("INSERT INTO {$this->_tableName}\n                        (master_id, baz) VALUES ('1', 'aha')");
     parent::__construct($config);
 }
 public function __construct()
 {
     $this->_tableName = 'master' . uniqid();
     $config['table'] = $this->_tableName;
     Kwf_Registry::get('db')->query("CREATE TABLE {$this->_tableName} (\n            `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY\n        ) ENGINE = INNODB");
     Kwf_Registry::get('db')->query("INSERT INTO {$this->_tableName}\n                        (id) VALUES ('1')");
     Kwf_Registry::get('db')->query("INSERT INTO {$this->_tableName}\n                        (id) VALUES ('2')");
     parent::__construct($config);
 }
 public function __construct($config = array())
 {
     $today = date('Y-m-d');
     $tomorrow = date('Y-m-d', strtotime("{$today} +1 day"));
     $this->_tableName = uniqid('dbtest');
     $config['table'] = $this->_tableName;
     $config['exprs'] = array('age' => new Kwf_Model_Select_Expr_Date_Age('birth'), 'age_ref' => new Kwf_Model_Select_Expr_Date_Age('birth', new Kwf_Date($tomorrow)));
     parent::__construct($config);
 }
 public function __construct($config = array())
 {
     $this->_tableName = 'master' . uniqid();
     $config['table'] = $this->_tableName;
     Kwf_Registry::get('db')->query("CREATE TABLE {$this->_tableName} (\n            `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,\n            `foo` VARCHAR( 200 ) NOT NULL ,\n            `bar` VARCHAR( 200 ) NOT NULL\n        ) ENGINE = INNODB");
     Kwf_Registry::get('db')->query("INSERT INTO {$this->_tableName}\n                        (id, foo, bar) VALUES ('1', 'aaabbbccc', 'abcd')");
     Kwf_Registry::get('db')->query("INSERT INTO {$this->_tableName}\n                        (id, foo, bar) VALUES ('2', 'bam', 'bum')");
     parent::__construct($config);
 }
 public function __construct()
 {
     $this->_tableName = 'relation_sibling' . uniqid();
     $config['table'] = $this->_tableName;
     Kwf_Registry::get('db')->query("CREATE TABLE {$this->_tableName} (\n            `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,\n            `foo` INT NOT NULL\n        ) ENGINE = INNODB");
     Kwf_Registry::get('db')->query("INSERT INTO {$this->_tableName}\n                        (id, foo) VALUES ('1', 123)");
     Kwf_Registry::get('db')->query("INSERT INTO {$this->_tableName}\n                        (id, foo) VALUES ('2', 321)");
     parent::__construct($config);
 }
 public function __construct($config = array())
 {
     $this->_tableName = uniqid('dbtest_middle');
     $config['table'] = $this->_tableName;
     $this->_referenceMap = array('Parent' => 'parent_id->Kwf_Model_DbWithConnection_ParentParentExpr_ParentModel');
     $this->_dependentModels['Childs'] = 'Kwf_Model_DbWithConnection_ParentParentExpr_ChildModel';
     $this->_exprs['parent_foo'] = new Kwf_Model_Select_Expr_Parent('Parent', 'foo');
     $this->_exprs['child_count'] = new Kwf_Model_Select_Expr_Child_Count('Childs', null);
     parent::__construct($config);
 }
 public function __construct($config = array())
 {
     $this->_tableName = uniqid('dbtest_child');
     $config['table'] = $this->_tableName;
     $this->_referenceMap = array('Parent' => 'parent_id->Kwf_Model_DbWithConnection_ParentExprIf_ParentModel');
     $this->_exprs['bar_is_null'] = new Kwf_Model_Select_Expr_IsNull('bar');
     $this->_exprs['if_field'] = new Kwf_Model_Select_Expr_If(new Kwf_Model_Select_Expr_Field('bar_is_null'), new Kwf_Model_Select_Expr_Parent('Parent', 'id'), new Kwf_Model_Select_Expr_Parent('Parent', 'parent_value'));
     $this->_exprs['if_field_sibling'] = new Kwf_Model_Select_Expr_If(new Kwf_Model_Select_Expr_Field('bar_is_null'), new Kwf_Model_Select_Expr_Parent('Parent', 'id'), new Kwf_Model_Select_Expr_Parent('Parent', 'sibling_value'));
     $this->_exprs['parent_value'] = new Kwf_Model_Select_Expr_Parent('Parent', 'parent_value');
     $this->_exprs['sibling_value'] = new Kwf_Model_Select_Expr_Parent('Parent', 'sibling_value');
     parent::__construct($config);
 }
 public function __construct($config = array())
 {
     $this->_tableName = uniqid('dbtest');
     $config['table'] = $this->_tableName;
     $config['exprs'] = array();
     $config['exprs']['count_model2'] = new Kwf_Model_Select_Expr_Child_Count('Model2');
     $config['exprs']['count_model2_field'] = new Kwf_Model_Select_Expr_Child('Model2', new Kwf_Model_Select_Expr_Count('foo2'));
     $config['exprs']['count_model2_distinct'] = new Kwf_Model_Select_Expr_Child('Model2', new Kwf_Model_Select_Expr_Count('foo2', true));
     $config['exprs']['sum_model2'] = new Kwf_Model_Select_Expr_Child('Model2', new Kwf_Model_Select_Expr_Sum('foo2'));
     $select = new Kwf_Model_Select();
     $select->whereEquals('bar', 'bam');
     $config['exprs']['count_model2_bam'] = new Kwf_Model_Select_Expr_Child('Model2', new Kwf_Model_Select_Expr_Count(), $select);
     $config['exprs']['count_model2_bam_distinct'] = new Kwf_Model_Select_Expr_Child('Model2', new Kwf_Model_Select_Expr_Count('foo2', true), $select);
     $config['exprs']['sum_model2_bam'] = new Kwf_Model_Select_Expr_Child('Model2', new Kwf_Model_Select_Expr_Sum('foo2'), $select);
     parent::__construct($config);
 }
 public function __construct($config = array())
 {
     $this->_tableName = uniqid('dbtest2');
     $config['table'] = $this->_tableName;
     $config['exprs'] = array();
     $config['exprs']['model1_bar'] = new Kwf_Model_Select_Expr_Parent('Model1', 'bar');
     $config['exprs']['model1_bar_concat_foo2'] = new Kwf_Model_Select_Expr_Concat(array(new Kwf_Model_Select_Expr_Parent('Model1', 'bar'), 'foo2'));
     $config['exprs']['model1_bar_concat_string'] = new Kwf_Model_Select_Expr_Concat(array(new Kwf_Model_Select_Expr_Parent('Model1', 'bar'), new Kwf_Model_Select_Expr_String('_string')));
     $config['exprs']['model1_bar_concat_foo2_bar_string'] = new Kwf_Model_Select_Expr_Concat(array(new Kwf_Model_Select_Expr_Parent('Model1', 'bar'), 'foo2', 'bar', new Kwf_Model_Select_Expr_String('_string')));
     $config['exprs']['strpad_3_right'] = new Kwf_Model_Select_Expr_StrPad('bar', 3, '0');
     $config['exprs']['strpad_4_right'] = new Kwf_Model_Select_Expr_StrPad('bar', 4, '0');
     $config['exprs']['strpad_6_right'] = new Kwf_Model_Select_Expr_StrPad('bar', 6, '0');
     $config['exprs']['strpad_3_left'] = new Kwf_Model_Select_Expr_StrPad('bar', 3, '0', Kwf_Model_Select_Expr_StrPad::LEFT);
     $config['exprs']['strpad_4_left'] = new Kwf_Model_Select_Expr_StrPad('bar', 4, '0', Kwf_Model_Select_Expr_StrPad::LEFT);
     $config['exprs']['strpad_6_left'] = new Kwf_Model_Select_Expr_StrPad('bar', 6, '0', Kwf_Model_Select_Expr_StrPad::LEFT);
     parent::__construct($config);
 }
 public function __construct($config = array())
 {
     $this->_table = new Kwf_Form_CardsRealModels_Model_FirstnameTable();
     parent::__construct($config);
 }
 public function __construct($config = array())
 {
     $this->_tableName = uniqid('dbtest');
     $config['table'] = $this->_tableName;
     parent::__construct($config);
 }
Exemple #28
0
 public function __construct(array $config = array())
 {
     $this->_referenceMap['User'] = '******' . get_class(Kwf_Registry::get('userModel'));
     parent::__construct($config);
 }
 public function __construct($config = array())
 {
     $config['table'] = Kwf_Model_Abstract::getInstance('Kwf_Model_DbWithConnection_SelectExpr_Model1')->getTableName();
     $config['exprs'] = array('count_model2' => new Kwf_Model_Select_Expr_Child_Count('Model2'));
     parent::__construct($config);
 }
 public function __construct($config = array())
 {
     $config['table'] = Kwf_Model_Abstract::getInstance('Kwf_Model_DbWithConnection_SelectExpr_Model2')->getTableName();
     parent::__construct($config);
 }