Menu

## OneToManyCollection
in package
implements Collection

OneToManyCollection.php : 18

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

OneToManyCollection.php : 20
`private array<string|int, mixed> $collection`

#### $entityManager

OneToManyCollection.php : 30
`private EntityManagerInterface $entityManager`

#### $numberOfRows

OneToManyCollection.php : 21
`private int $numberOfRows`

#### $typeClass

OneToManyCollection.php : 31
`private string $typeClass`

### Methods

#### __construct()

OneToManyCollection.php : 29

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 —

#### add()

OneToManyCollection.php : 89
`public add(mixed $element) : true|void`

##### Parameters

$element : mixed

##### Tags

throws
  WrongTypeException

##### Return values

true|void —

#### clear()

OneToManyCollection.php : 104

Clears the collection.

`public clear() : mixed`

##### Return values

mixed —

#### contains()

OneToManyCollection.php : 118
`public contains(mixed $element) : bool`

##### Parameters

$element : mixed

##### Return values

bool —

#### containsKey()

OneToManyCollection.php : 166
`public containsKey(int|string $key) : bool`

##### Parameters

$key : int|string

##### Return values

bool —

#### count()

OneToManyCollection.php : 54
`public count() : int`

##### Tags

throws
  NonUniqueResultException

##### Return values

int —

#### current()

OneToManyCollection.php : 258
`public current() : mixed|object`

##### Return values

mixed|object —

#### exists()

OneToManyCollection.php : 268
`public exists(Closure $p) : bool`

##### Parameters

$p : Closure

##### Tags

throws
  NotImplementedException

##### Return values

bool —

#### filter()

OneToManyCollection.php : 278
`public filter(Closure $p) : Collection|void`

##### Parameters

$p : Closure

##### Tags

throws
  NotImplementedException

##### Return values

Collection|void —

#### first()

OneToManyCollection.php : 226
`public first() : mixed`

##### Return values

mixed —

#### forAll()

OneToManyCollection.php : 288
`public forAll(Closure $p) : bool|void`

##### Parameters

$p : Closure

##### Tags

throws
  NotImplementedException

##### Return values

bool|void —

#### get()

OneToManyCollection.php : 177

Returns the element saved with the given key.

`public get(int|string $key) : mixed`

##### Parameters

$key : int|string

##### Tags

throws
  KeyNotFoundException

##### Return values

mixed —

#### getIterator()

OneToManyCollection.php : 339

Gets a Iterator over this collection.

`public getIterator() : ArrayIterator`

##### Return values

ArrayIterator —

#### getKeys()

OneToManyCollection.php : 188
`public getKeys() : array<string|int, mixed>`

##### Return values

array<string|int, mixed> —

#### getTypeClass()

OneToManyCollection.php : 45

Returns the class this collection consists of.

`public getTypeClass() : ClassMetadata`

##### Return values

ClassMetadata —

#### getValues()

OneToManyCollection.php : 196
`public getValues() : array<string|int, mixed>`

##### Return values

array<string|int, mixed> —

#### indexOf()

OneToManyCollection.php : 318
`public indexOf(mixed $element) : bool|false|int|string`

##### Parameters

$element : mixed

##### Tags

throws
  WrongTypeException

##### Return values

bool|false|int|string —

#### isEmpty()

OneToManyCollection.php : 132
`public isEmpty() : bool`

##### Return values

bool —

#### key()

OneToManyCollection.php : 242
`public key() : int|string|null`

##### Return values

int|string|null —

#### last()

OneToManyCollection.php : 234
`public last() : mixed`

##### Return values

mixed —

#### map()

OneToManyCollection.php : 298
`public map(Closure $p) : Collection|void`

##### Parameters

$p : Closure

##### Tags

throws
  NotImplementedException

##### Return values

Collection|void —

#### next()

OneToManyCollection.php : 250
`public next() : mixed|object`

##### Return values

mixed|object —

#### offsetExists()

OneToManyCollection.php : 375
`public offsetExists(mixed $key) : bool`

##### Parameters

$key : mixed

##### Return values

bool —

#### offsetGet()

OneToManyCollection.php : 349
`public offsetGet(mixed $key) : mixed`

##### Parameters

$key : mixed

##### Tags

throws
  KeyNotFoundException

##### Return values

mixed —

#### offsetSet()

OneToManyCollection.php : 358
`public offsetSet(mixed $key, mixed $element) : mixed`

##### Parameters

$key : mixed
$element : mixed

##### Return values

mixed —

#### offsetUnset()

OneToManyCollection.php : 366
`public offsetUnset(mixed $key) : mixed`

##### Parameters

$key : mixed

##### Return values

mixed —

#### partition()

OneToManyCollection.php : 308
`public partition(Closure $p) : array<string|int, Collection>|void`

##### Parameters

$p : Closure

##### Tags

throws
  NotImplementedException

##### Return values

array<string|int, Collection>|void —

#### remove()

OneToManyCollection.php : 141
`public remove(int|string $key) : mixed|void`

##### Parameters

$key : int|string

##### Return values

mixed|void —

#### removeElement()

OneToManyCollection.php : 153
`public removeElement(mixed $element) : bool|void`

##### Parameters

$element : mixed

##### Return values

bool|void —

#### set()

OneToManyCollection.php : 206
`public set(int|string $key, mixed $value) : mixed`

##### Parameters

$key : int|string
$value : mixed

##### Tags

throws
  WrongTypeException

##### Return values

mixed —

#### slice()

OneToManyCollection.php : 330
`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()

OneToManyCollection.php : 218
`public toArray() : array<string|int, mixed>`

##### Return values

array<string|int, mixed> —

#### checkElementType()

OneToManyCollection.php : 77

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