Storm\Core\Object\Domain::PersistedRelationship PHP Метод

PersistedRelationship() закрытый публичный Метод

Constructs a discarded non-identifying relationship between the two supplied entities.
final public PersistedRelationship ( $ParentEntity, object $RelatedEntity ) : PersistedRelationship
$RelatedEntity object
Результат PersistedRelationship The persisted relationship
    public final function PersistedRelationship($ParentEntity, $RelatedEntity)
    {
        $ParentIdentity = $this->VerifyEntity(__METHOD__, $ParentEntity)->Identity($ParentEntity);
        $RelatedIdentity = $this->VerifyEntity(__METHOD__, $RelatedEntity)->Identity($RelatedEntity);
        return new PersistedRelationship($ParentIdentity, $RelatedIdentity);
    }

Usage Example

Пример #1
0
 public function GetPersistedRelationship(Object\Domain $Domain, Object\UnitOfWork $UnitOfWork, $ParentEntity, $RelatedEntity)
 {
     if ($this->CascadePersist && $this->IsEntityAltered($RelatedEntity)) {
         $UnitOfWork->Persist($RelatedEntity);
     }
     return $Domain->PersistedRelationship($ParentEntity, $RelatedEntity);
 }