コード例 #1
0
ファイル: RecordSchema.php プロジェクト: spiral/components
 /**
  * @param SchemaBuilder $builder Parent ORM schema (all other documents).
  * @param string        $class   Class name.
  * @throws \ReflectionException
  * @throws DefinitionException
  * @throws RecordSchemaException
  */
 public function __construct(SchemaBuilder $builder, $class)
 {
     parent::__construct($class);
     $this->builder = $builder;
     //Associated table
     $this->tableSchema = $this->builder->declareTable($this->getDatabase(), $this->getTable());
 }
コード例 #2
0
ファイル: RecordSchema.php プロジェクト: jwdeitch/components
 /**
  * @param SchemaBuilder $builder Parent ORM schema (all other documents).
  * @param string        $class   Class name.
  * @throws \ReflectionException
  * @throws DefinitionException
  * @throws RecordSchemaException
  */
 public function __construct(SchemaBuilder $builder, $class)
 {
     parent::__construct($class);
     $this->builder = $builder;
     //Associated table
     $this->tableSchema = $this->builder->declareTable($this->getDatabase(), $this->getTable());
     /**
      * Use record schema (property) to declare table indexes, columns and default values.
      * No relations has to be declared at this point.
      */
     $this->castSchema();
 }