LazyRecord\Schema\Factory\CollectionClassFactory::create PHP Method

create() public static method

public static create ( DeclareSchema $schema )
$schema lazyrecord\schema\DeclareSchema
    public static function create(DeclareSchema $schema)
    {
        $cTemplate = new ClassFile($schema->getCollectionClass());
        $cTemplate->extendClass('\\' . $schema->getBaseCollectionClass());
        return $cTemplate;
    }

Usage Example

Beispiel #1
0
 /**
  * Generate collection class from a schema object.
  *
  * @param DeclareSchema $schema
  * @return array class name, class file path
  */
 public function generateCollectionClass(DeclareSchema $schema)
 {
     $cTemplate = CollectionClassFactory::create($schema);
     return $this->updateClassFile($cTemplate, $schema, false);
 }
CollectionClassFactory