Neos\Flow\Reflection\ClassSchema::isAggregateRoot PHP Method

isAggregateRoot() public method

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

Usage Example

コード例 #1
0
 /**
  * @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());
 }