コード例 #1
0
ファイル: Table.php プロジェクト: disider/Propel2
 /**
  * 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;
 }
コード例 #2
0
ファイル: Table.php プロジェクト: rouffj/Propel2
 /**
  * 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;
 }
コード例 #3
0
 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());
 }