public function testCreateValues() { $node = new SdlTag(null, ["foo", "bar"]); $this->assertTrue($node instanceof SdlTag); $this->assertEquals(count($node->getValues()), 2); $this->assertEquals("foo", $node[0]); $this->assertEquals("bar", $node[1]); $this->assertEquals("foo", $node->getValue(0)); $this->assertEquals("bar", $node->getValue(1)); }
public function applySdlTag(\Cherry\Data\Ddl\SdlTag $node) { if ($node->getName() == 'table') { if ($node->getValue() != $this->name) { \App::app()->warn("Not applying SDL node to table as names differ: " . $node->getValue()); return false; } $cur = $this->getSdlTag(); foreach ($node->getChildren('column') as $col) { $curcol = $cur->getChild('column', $col->getValue()); // Check if the node if ($curcol == null || $curcol != $col) { echo "Column " . $col->getName() . " needs creating/applying!\n"; } } } }