コード例 #1
0
 public function testCreateNewColumn()
 {
     $column = new Column('title');
     $this->assertSame('title', $column->getName());
     $this->assertEmpty($column->getAutoIncrementString());
     $this->assertSame('COL_TITLE', $column->getConstantName());
     $this->assertSame('public', $column->getMutatorVisibility());
     $this->assertSame('public', $column->getAccessorVisibility());
     $this->assertFalse($column->getSize());
     $this->assertFalse($column->hasPlatform());
     $this->assertFalse($column->hasReferrers());
     $this->assertFalse($column->isAutoIncrement());
     $this->assertFalse($column->isEnumeratedClasses());
     $this->assertFalse($column->isLazyLoad());
     $this->assertFalse($column->isNamePlural());
     $this->assertFalse($column->isNestedSetLeftKey());
     $this->assertFalse($column->isNestedSetRightKey());
     $this->assertFalse($column->isNotNull());
     $this->assertFalse($column->isNodeKey());
     $this->assertFalse($column->isPrimaryKey());
     $this->assertFalse($column->isPrimaryString());
     $this->assertFalse($column->isTreeScopeKey());
     $this->assertFalse($column->isUnique());
     $this->assertFalse($column->requiresTransactionInPostgres());
 }
コード例 #2
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;
 }
コード例 #3
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;
 }