public function test__update_nested_rollback() { $this->__init(); $data = $this->object->create(['title' => 'title_1', 'price' => 100, StoreCatalog::PROP_LINKED_URL_TABLE_NAME => [['url' => 'http://google.com', 'alt' => 'Pot1'], ['url' => 'http://google.com2', 'alt' => 'Pot3']]]); $data[StoreCatalog::PROP_LINKED_URL_TABLE_NAME] = ['url' => 'http://google.com3', 'alt' => 'Pot4', 'ttt' => 'asd']; $data[StoreCatalog::PROP_LINKED_URL_TABLE_NAME] = ['url' => 'http://google.com-1', 'alt' => 'Pot1-1']; try { $this->object->update($data); } catch (DataStoreException $e) { $query = new Query(); $query->setQuery(new AndNode([new EqNode('url', 'http://google.com-1'), new EqNode('alt', 'Pot1-1')])); $prop = new Prop(new TableGateway(StoreCatalog::PROP_LINKED_URL_TABLE_NAME, $this->container->get('db'))); $result = $prop->query($query); $this->assertEquals(0, count($result)); return; } $this->fail("An expected exception has not been raised."); }
public function __construct(TableGateway $dbTable, $joinedEntities) { //$dbTable - TableGateway for SysEntities table parent::__construct($dbTable); $this->joinedEntities = $joinedEntities; }