PHP Class Nextras\Orm\Relationships\HasMany

Inheritance: extends Nette\Object, implements Nextras\Orm\Relationships\IRelationshipCollection
Afficher le fichier Open project: nextras/orm

Protected Properties

Свойство Type Description
$added Nextras\Orm\Entity\IEntity[]
$collection Nextras\Orm\Collection\ICollection
$isModified boolean
$metadata Nextras\Orm\Entity\Reflection\PropertyMetadata
$parent Nextras\Orm\Entity\IEntity
$relationshipMapper Nextras\Orm\Mapper\IRelationshipMapper
$removed Nextras\Orm\Entity\IEntity[]
$targetRepository Nextras\Orm\Repository\IRepository
$toAdd Nextras\Orm\Entity\IEntity[]
$toRemove Nextras\Orm\Entity\IEntity[]
$updatingReverseRelationship boolean
$wasLoaded boolean

Méthodes publiques

Méthode Description
__clone ( )
__construct ( Nextras\Orm\Entity\IEntity $parent, PropertyMetadata $metadata )
add ( $entity )
count ( )
countStored ( )
get ( )
getIterator ( ) : Nextras\Orm\Collection\ICollection | Nextras\Orm\Entity\IEntity[] | Traversable
getRawValue ( ) : mixed[] Returns primary values of enitities in relationship.
has ( $entity )
initReverseRelationship ( Nextras\Orm\Entity\IEntity $entity )
isLoaded ( )
isModified ( )
remove ( $entity )
set ( array $data )
setInjectedValue ( $value )
setParent ( Nextras\Orm\Entity\IEntity $parent )
setRawValue ( $value )

Méthodes protégées

Méthode Description
applyDefaultOrder ( Nextras\Orm\Collection\ICollection $collection )
createCollection ( ) : Nextras\Orm\Collection\ICollection Returns collection for has many relationship.
createEntity ( Nextras\Orm\Entity\IEntity | mixed $entity, boolean $need = true ) : Nextras\Orm\Entity\IEntity
getCachedCollection ( ) : Nextras\Orm\Collection\ICollection
getCollection ( $forceNew = false ) : Nextras\Orm\Collection\ICollection
getRelationshipMapper ( )
getTargetRepository ( ) : Nextras\Orm\Repository\IRepository
modify ( ) : void Sets relationship (and entity) as modified.
updateRelationshipAdd ( Nextras\Orm\Entity\IEntity $entity ) : void Updates relationship change for the $entity.
updateRelationshipRemove ( Nextras\Orm\Entity\IEntity $entity ) : void Updates relationship change for the $entity.

Method Details

__clone() public méthode

public __clone ( )

__construct() public méthode

public __construct ( Nextras\Orm\Entity\IEntity $parent, PropertyMetadata $metadata )
$parent Nextras\Orm\Entity\IEntity
$metadata Nextras\Orm\Entity\Reflection\PropertyMetadata

add() public méthode

public add ( $entity )

applyDefaultOrder() protected méthode

protected applyDefaultOrder ( Nextras\Orm\Collection\ICollection $collection )
$collection Nextras\Orm\Collection\ICollection

count() public méthode

public count ( )

countStored() public méthode

public countStored ( )

createCollection() abstract protected méthode

Returns collection for has many relationship.
abstract protected createCollection ( ) : Nextras\Orm\Collection\ICollection
Résultat Nextras\Orm\Collection\ICollection

createEntity() protected méthode

protected createEntity ( Nextras\Orm\Entity\IEntity | mixed $entity, boolean $need = true ) : Nextras\Orm\Entity\IEntity
$entity Nextras\Orm\Entity\IEntity | mixed
$need boolean
Résultat Nextras\Orm\Entity\IEntity

get() public méthode

public get ( )

getCachedCollection() protected méthode

protected getCachedCollection ( ) : Nextras\Orm\Collection\ICollection
Résultat Nextras\Orm\Collection\ICollection

getCollection() protected méthode

protected getCollection ( $forceNew = false ) : Nextras\Orm\Collection\ICollection
Résultat Nextras\Orm\Collection\ICollection

getIterator() public méthode

public getIterator ( ) : Nextras\Orm\Collection\ICollection | Nextras\Orm\Entity\IEntity[] | Traversable
Résultat Nextras\Orm\Collection\ICollection | Nextras\Orm\Entity\IEntity[] | Traversable

getRawValue() public méthode

Returns primary values of enitities in relationship.
public getRawValue ( ) : mixed[]
Résultat mixed[]

getRelationshipMapper() protected méthode

protected getRelationshipMapper ( )

getTargetRepository() protected méthode

protected getTargetRepository ( ) : Nextras\Orm\Repository\IRepository
Résultat Nextras\Orm\Repository\IRepository

has() public méthode

public has ( $entity )

initReverseRelationship() public méthode

public initReverseRelationship ( Nextras\Orm\Entity\IEntity $entity )
$entity Nextras\Orm\Entity\IEntity

isLoaded() public méthode

public isLoaded ( )

isModified() public méthode

public isModified ( )

modify() abstract protected méthode

Sets relationship (and entity) as modified.
abstract protected modify ( ) : void
Résultat void

remove() public méthode

public remove ( $entity )

set() public méthode

public set ( array $data )
$data array

setInjectedValue() public méthode

public setInjectedValue ( $value )

setParent() public méthode

public setParent ( Nextras\Orm\Entity\IEntity $parent )
$parent Nextras\Orm\Entity\IEntity

setRawValue() public méthode

public setRawValue ( $value )

updateRelationshipAdd() abstract protected méthode

Updates relationship change for the $entity.
abstract protected updateRelationshipAdd ( Nextras\Orm\Entity\IEntity $entity ) : void
$entity Nextras\Orm\Entity\IEntity
Résultat void

updateRelationshipRemove() abstract protected méthode

Updates relationship change for the $entity.
abstract protected updateRelationshipRemove ( Nextras\Orm\Entity\IEntity $entity ) : void
$entity Nextras\Orm\Entity\IEntity
Résultat void

Property Details

$added protected_oe property

protected IEntity[],Nextras\Orm\Entity $added
Résultat Nextras\Orm\Entity\IEntity[]

$collection protected_oe property

protected ICollection,Nextras\Orm\Collection $collection
Résultat Nextras\Orm\Collection\ICollection

$isModified protected_oe property

protected bool $isModified
Résultat boolean

$metadata protected_oe property

protected PropertyMetadata,Nextras\Orm\Entity\Reflection $metadata
Résultat Nextras\Orm\Entity\Reflection\PropertyMetadata

$parent protected_oe property

protected IEntity,Nextras\Orm\Entity $parent
Résultat Nextras\Orm\Entity\IEntity

$relationshipMapper protected_oe property

protected IRelationshipMapper,Nextras\Orm\Mapper $relationshipMapper
Résultat Nextras\Orm\Mapper\IRelationshipMapper

$removed protected_oe property

protected IEntity[],Nextras\Orm\Entity $removed
Résultat Nextras\Orm\Entity\IEntity[]

$targetRepository protected_oe property

protected IRepository,Nextras\Orm\Repository $targetRepository
Résultat Nextras\Orm\Repository\IRepository

$toAdd protected_oe property

protected IEntity[],Nextras\Orm\Entity $toAdd
Résultat Nextras\Orm\Entity\IEntity[]

$toRemove protected_oe property

protected IEntity[],Nextras\Orm\Entity $toRemove
Résultat Nextras\Orm\Entity\IEntity[]

$updatingReverseRelationship protected_oe property

protected bool $updatingReverseRelationship
Résultat boolean

$wasLoaded protected_oe property

protected bool $wasLoaded
Résultat boolean