Neos\Flow\Reflection\ClassSchema::isAggregateRoot PHP 메소드

isAggregateRoot() 공개 메소드

Whether the class is accessible through a repository and therefore an aggregate root.
public isAggregateRoot ( ) : boolean
리턴 boolean TRUE
    public function isAggregateRoot()
    {
        return $this->repositoryClassName !== null;
    }

Usage Example

 /**
  * @test
  */
 public function setModelTypeResetsIdentityPropertiesAndAggregateRootForValueObjects()
 {
     $classSchema = new ClassSchema('SomeClass');
     $classSchema->setModelType(ClassSchema::MODELTYPE_ENTITY);
     $classSchema->addProperty('foo', 'string');
     $classSchema->addProperty('bar', 'string');
     $classSchema->markAsIdentityProperty('bar');
     $classSchema->setRepositoryClassName('Some\\Repository');
     $this->assertSame(['bar' => 'string'], $classSchema->getIdentityProperties());
     $classSchema->setModelType(ClassSchema::MODELTYPE_VALUEOBJECT);
     $this->assertSame([], $classSchema->getIdentityProperties());
     $this->assertFalse($classSchema->isAggregateRoot());
 }