OneToManyCollection
in package
implements
Collection
A one-to-many relation between two entities.
Interfaces, Classes and Traits
- Collection
Table of Contents
- $collection : array<string|int, mixed>
- $entityManager : EntityManagerInterface
- $numberOfRows : int
- $typeClass : string
- __construct() : mixed
- Constructor for a one to many colelction of type $typeClass.
- add() : true|void
- clear() : mixed
- Clears the collection.
- contains() : bool
- containsKey() : bool
- count() : int
- current() : mixed|object
- exists() : bool
- filter() : Collection|void
- first() : mixed
- forAll() : bool|void
- get() : mixed
- Returns the element saved with the given key.
- getIterator() : ArrayIterator
- Gets a Iterator over this collection.
- getKeys() : array<string|int, mixed>
- getTypeClass() : ClassMetadata
- Returns the class this collection consists of.
- getValues() : array<string|int, mixed>
- indexOf() : bool|false|int|string
- isEmpty() : bool
- key() : int|string|null
- last() : mixed
- map() : Collection|void
- next() : mixed|object
- offsetExists() : bool
- offsetGet() : mixed
- offsetSet() : mixed
- offsetUnset() : mixed
- partition() : array<string|int, Collection>|void
- remove() : mixed|void
- removeElement() : bool|void
- set() : mixed
- slice() : array<string|int, mixed>|void
- toArray() : array<string|int, mixed>
- checkElementType() : mixed
- Checks if the element matches the type of this collection.
Properties
$collection
private
array<string|int, mixed>
$collection
$entityManager
private
EntityManagerInterface
$entityManager
$numberOfRows
private
int
$numberOfRows
$typeClass
private
string
$typeClass
Methods
__construct()
Constructor for a one to many colelction of type $typeClass.
public
__construct(EntityManagerInterface $entityManager, string $typeClass) : mixed
Parameters
- $entityManager : EntityManagerInterface
- $typeClass : string
Tags
Return values
mixed —add()
public
add(mixed $element) : true|void
Parameters
- $element : mixed
Tags
Return values
true|void —clear()
Clears the collection.
public
clear() : mixed
Return values
mixed —contains()
public
contains(mixed $element) : bool
Parameters
- $element : mixed
Return values
bool —containsKey()
public
containsKey(int|string $key) : bool
Parameters
- $key : int|string
Return values
bool —count()
public
count() : int
Tags
Return values
int —current()
public
current() : mixed|object
Return values
mixed|object —exists()
public
exists(Closure $p) : bool
Parameters
- $p : Closure
Tags
Return values
bool —filter()
public
filter(Closure $p) : Collection|void
Parameters
- $p : Closure
Tags
Return values
Collection|void —first()
public
first() : mixed
Return values
mixed —forAll()
public
forAll(Closure $p) : bool|void
Parameters
- $p : Closure
Tags
Return values
bool|void —get()
Returns the element saved with the given key.
public
get(int|string $key) : mixed
Parameters
- $key : int|string
Tags
Return values
mixed —getIterator()
Gets a Iterator over this collection.
public
getIterator() : ArrayIterator
Return values
ArrayIterator —getKeys()
public
getKeys() : array<string|int, mixed>
Return values
array<string|int, mixed> —getTypeClass()
Returns the class this collection consists of.
public
getTypeClass() : ClassMetadata
Return values
ClassMetadata —getValues()
public
getValues() : array<string|int, mixed>
Return values
array<string|int, mixed> —indexOf()
public
indexOf(mixed $element) : bool|false|int|string
Parameters
- $element : mixed
Tags
Return values
bool|false|int|string —isEmpty()
public
isEmpty() : bool
Return values
bool —key()
public
key() : int|string|null
Return values
int|string|null —last()
public
last() : mixed
Return values
mixed —map()
public
map(Closure $p) : Collection|void
Parameters
- $p : Closure
Tags
Return values
Collection|void —next()
public
next() : mixed|object
Return values
mixed|object —offsetExists()
public
offsetExists(mixed $key) : bool
Parameters
- $key : mixed
Return values
bool —offsetGet()
public
offsetGet(mixed $key) : mixed
Parameters
- $key : mixed
Tags
Return values
mixed —offsetSet()
public
offsetSet(mixed $key, mixed $element) : mixed
Parameters
- $key : mixed
- $element : mixed
Return values
mixed —offsetUnset()
public
offsetUnset(mixed $key) : mixed
Parameters
- $key : mixed
Return values
mixed —partition()
public
partition(Closure $p) : array<string|int, Collection>|void
Parameters
- $p : Closure
Tags
Return values
array<string|int, Collection>|void —remove()
public
remove(int|string $key) : mixed|void
Parameters
- $key : int|string
Return values
mixed|void —removeElement()
public
removeElement(mixed $element) : bool|void
Parameters
- $element : mixed
Return values
bool|void —set()
public
set(int|string $key, mixed $value) : mixed
Parameters
- $key : int|string
- $value : mixed
Tags
Return values
mixed —slice()
public
slice(int $offset[, null $length = null ]) : array<string|int, mixed>|void
Parameters
- $offset : int
- $length : null = null
Tags
Return values
array<string|int, mixed>|void —toArray()
public
toArray() : array<string|int, mixed>
Return values
array<string|int, mixed> —checkElementType()
Checks if the element matches the type of this collection.
private
checkElementType(mixed $element) : mixed
Parameters
- $element : mixed