public function addData() { $data = array_merge(CompositeStoreExample::$product, CompositeStoreExample::$images, CompositeStoreExample::$category, CompositeStoreExample::$categoryProduct); foreach ($data as $key => $value) { $sql = new MultiInsertSql($this->dbAdapter, $key); $tableGateway = new TableGateway($key, $this->dbAdapter, null, null, $sql); $dataStore = new DbTable($tableGateway); $dataStore->create($value, true); } }
public function addData() { $data = array_merge(EavExampleStoreCatalog::$sys_entities, EavExampleStoreCatalog::$entity_product, EavExampleStoreCatalog::$entity_category, EavExampleStoreCatalog::$entity_tag, EavExampleStoreCatalog::$entity_mainicon, EavExampleStoreCatalog::$entity_main_specific, EavExampleStoreCatalog::$prop_tag, EavExampleStoreCatalog::$prop_product_category, EavExampleStoreCatalog::$prop_linked_url); foreach ($data as $key => $value) { $sql = new MultiInsertSql($this->dbAdapter, $key); $tableGateway = new TableGateway($key, $this->dbAdapter, null, null, $sql); $dataStore = new DbTable($tableGateway); echo "create {$key}" . PHP_EOL; $dataStore->create($value, true); } }
public function __construct($rockyMountainDbAdapter = null) { //set $this->rockyMountainDbAdapter as $cotainer->get('rockyMountainDbAdapter'); InsideConstruct::initServices(); $dbTable = new TableGateway(static::TABLE_NAME, $this->rockyMountainDbAdapter); parent::__construct($dbTable); }
public function __construct($emailDbAdapter = null) { //set $this->emailDbAdapter as $cotainer->get('emailDbAdapter'); InsideConstruct::initServices(); $dbTable = new TableGateway(static::TABLE_NAME, $this->emailDbAdapter); parent::__construct($dbTable); $this->apiEmail = new ApiGmail(); }
public function testSelectAggregateFunction_Combo_True() { $this->_initObject(); $query = new Query(); $aggregateCount = new AggregateFunctionNode('count', 'id'); $aggregateMaxId = new AggregateFunctionNode('max', 'id'); $aggregateMinId = new AggregateFunctionNode('min', 'id'); $query->setLimit(new Node\LimitNode(2, 1)); $query->setQuery(new ScalarOperator\EqNode('fString', 'val2')); $query->setSelect(new XSelectNode([$aggregateCount, $aggregateMaxId, $aggregateMinId, "anotherId"])); $resp = $this->object->query($query); $this->assertEquals(1, count($resp)); $this->assertEquals(2, $resp[0]['id->count']); //$this->assertEquals(2, $resp[0]['count(id)']); $this->assertEquals(4, $resp[0]['id->max']); //$this->assertEquals(4, $resp[0]['max(id)']); $this->assertEquals(3, $resp[0]['id->min']); //$this->assertEquals(3, $resp[0]['min(id)']); $this->assertEquals(40, $resp[0]['anotherId']); //$this->assertEquals(40, $resp[0]['anotherId']); }
protected function _create($itemData, $rewriteIfExist = false) { return parent::_create($itemData, false); }