PHP Class Nextras\Orm\Relationships\HasMany

Inheritance: extends Nette\Object, implements Nextras\Orm\Relationships\IRelationshipCollection
Mostra file Open project: nextras/orm

Protected Properties

Property 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

Public Methods

Method 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 )

Protected Methods

Method 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 method

public __clone ( )

__construct() public method

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

add() public method

public add ( $entity )

applyDefaultOrder() protected method

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

count() public method

public count ( )

countStored() public method

public countStored ( )

createCollection() abstract protected method

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

createEntity() protected method

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

get() public method

public get ( )

getCachedCollection() protected method

protected getCachedCollection ( ) : Nextras\Orm\Collection\ICollection
return Nextras\Orm\Collection\ICollection

getCollection() protected method

protected getCollection ( $forceNew = false ) : Nextras\Orm\Collection\ICollection
return Nextras\Orm\Collection\ICollection

getIterator() public method

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

getRawValue() public method

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

getRelationshipMapper() protected method

protected getRelationshipMapper ( )

getTargetRepository() protected method

protected getTargetRepository ( ) : Nextras\Orm\Repository\IRepository
return Nextras\Orm\Repository\IRepository

has() public method

public has ( $entity )

initReverseRelationship() public method

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

isLoaded() public method

public isLoaded ( )

isModified() public method

public isModified ( )

modify() abstract protected method

Sets relationship (and entity) as modified.
abstract protected modify ( ) : void
return void

remove() public method

public remove ( $entity )

set() public method

public set ( array $data )
$data array

setInjectedValue() public method

public setInjectedValue ( $value )

setParent() public method

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

setRawValue() public method

public setRawValue ( $value )

updateRelationshipAdd() abstract protected method

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

updateRelationshipRemove() abstract protected method

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

Property Details

$added protected_oe property

protected IEntity[],Nextras\Orm\Entity $added
return Nextras\Orm\Entity\IEntity[]

$collection protected_oe property

protected ICollection,Nextras\Orm\Collection $collection
return Nextras\Orm\Collection\ICollection

$isModified protected_oe property

protected bool $isModified
return boolean

$metadata protected_oe property

protected PropertyMetadata,Nextras\Orm\Entity\Reflection $metadata
return Nextras\Orm\Entity\Reflection\PropertyMetadata

$parent protected_oe property

protected IEntity,Nextras\Orm\Entity $parent
return Nextras\Orm\Entity\IEntity

$relationshipMapper protected_oe property

protected IRelationshipMapper,Nextras\Orm\Mapper $relationshipMapper
return Nextras\Orm\Mapper\IRelationshipMapper

$removed protected_oe property

protected IEntity[],Nextras\Orm\Entity $removed
return Nextras\Orm\Entity\IEntity[]

$targetRepository protected_oe property

protected IRepository,Nextras\Orm\Repository $targetRepository
return Nextras\Orm\Repository\IRepository

$toAdd protected_oe property

protected IEntity[],Nextras\Orm\Entity $toAdd
return Nextras\Orm\Entity\IEntity[]

$toRemove protected_oe property

protected IEntity[],Nextras\Orm\Entity $toRemove
return Nextras\Orm\Entity\IEntity[]

$updatingReverseRelationship protected_oe property

protected bool $updatingReverseRelationship
return boolean

$wasLoaded protected_oe property

protected bool $wasLoaded
return boolean