Documentation

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

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
throws
ClassNotFoundException
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
throws
NonUniqueResultException
Return values
int

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>

offsetExists()

public offsetExists(mixed $key) : bool
Parameters
$key : mixed
Return values
bool

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

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

slice()

public slice(int $offset[, null $length = null ]) : array<string|int, mixed>|void
Parameters
$offset : int
$length : null = null
Tags
throws
NotImplementedException
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
Tags
throws
WrongTypeException
Return values
mixed

Search results