Doctrine\Tests\OXM\Mapping\User::loadMetadata PHP 메소드

loadMetadata() 공개 정적인 메소드

public static loadMetadata ( ClassMetadataInfo $metadata )
$metadata Doctrine\OXM\Mapping\ClassMetadataInfo
    public static function loadMetadata(ClassMetadataInfo $metadata)
    {
        $metadata->setXmlName('cms-user');
        $metadata->isRoot = true;
        $metadata->setXmlNamespaces(array(array('url' => 'http://www.schema.com/foo', 'prefix' => 'foo'), array('url' => 'http://www.schema.com/bar', 'prefix' => 'bar')));
        $metadata->addLifecycleCallback('doStuffOnPrePersist', 'prePersist');
        $metadata->addLifecycleCallback('doOtherStuffOnPrePersistToo', 'prePersist');
        $metadata->addLifecycleCallback('doStuffOnPostPersist', 'postPersist');
        $metadata->addLifecycleCallback('doStuffOnPreMarshal', 'preMarshal');
        $metadata->mapField(array('fieldName' => 'id', 'id' => true, 'type' => 'string', 'node' => 'attribute'));
        $metadata->mapField(array('fieldName' => 'name', 'type' => 'string', 'node' => 'text', 'required' => true, 'setMethod' => 'setUsername', 'getMethod' => 'getUsername'));
        $metadata->mapField(array('fieldName' => 'comments', 'type' => 'string', 'node' => 'text', 'collection' => true, 'wrapper' => 'comments', 'name' => 'comment'));
        $metadata->mapField(array('fieldName' => 'roles', 'type' => 'Role', 'node' => 'value', 'collection' => true, 'name' => 'role'));
    }