/** * Returns the subclasses that can be created from this table. * * @return array */ public function getChildrenNames() { if (null === $this->inheritanceColumn || !$this->inheritanceColumn->isEnumeratedClasses()) { return null; } $names = []; foreach ($this->inheritanceColumn->getChildren() as $child) { $names[] = get_class($child); } return $names; }
/** * Get the subclasses that can be created from this table. * @return array string[] Class names */ public function getChildrenNames() { if ($this->inheritanceColumn === null || !$this->inheritanceColumn->isEnumeratedClasses()) { return null; } $children = $this->inheritanceColumn->getChildren(); $names = array(); for ($i = 0, $size = count($children); $i < $size; $i++) { $names[] = get_class($children[$i]); } return $names; }
public function testAddArrayInheritance() { $column = new Column(); $column->addInheritance(array('key' => 'baz', 'extends' => 'BaseObject', 'class' => 'Foo\\Bar', 'package' => 'Foo')); $column->addInheritance(array('key' => 'foo', 'extends' => 'BaseObject', 'class' => 'Acme\\Foo', 'package' => 'Acme')); $this->assertCount(2, $column->getChildren()); }