PHP Class Nelmio\Alice\ObjectBag

Inheritance: implements IteratorAggregate, implements Countable
Mostrar archivo Open project: nelmio/alice Class Usage Examples

Public Methods

Method Description
__construct ( array $objects = [] )
count ( )
get ( Nelmio\Alice\FixtureIdInterface $fixture ) : Nelmio\Alice\ObjectInterface
getIterator ( )
has ( Nelmio\Alice\FixtureIdInterface $fixture ) : boolean
mergeWith ( self $objects ) : self Creates a new instance with the new objects. If objects with the same reference already exists, they will be overridden by the new ones.
toArray ( ) : array
with ( Nelmio\Alice\ObjectInterface $object ) : self Creates a new instance which will contain the given object. If an object with the same reference already exists, it will be overridden by the new object.
without ( Nelmio\Alice\FixtureInterface | Nelmio\Alice\ObjectInterface $objectOrFixture ) : self Creates a new instance which will no longer contain the given object.

Method Details

__construct() public method

public __construct ( array $objects = [] )
$objects array

count() public method

public count ( )

get() public method

public get ( Nelmio\Alice\FixtureIdInterface $fixture ) : Nelmio\Alice\ObjectInterface
$fixture Nelmio\Alice\FixtureIdInterface
return Nelmio\Alice\ObjectInterface

getIterator() public method

public getIterator ( )

has() public method

public has ( Nelmio\Alice\FixtureIdInterface $fixture ) : boolean
$fixture Nelmio\Alice\FixtureIdInterface
return boolean

mergeWith() public method

Creates a new instance with the new objects. If objects with the same reference already exists, they will be overridden by the new ones.
public mergeWith ( self $objects ) : self
$objects self
return self

toArray() public method

public toArray ( ) : array
return array

with() public method

Creates a new instance which will contain the given object. If an object with the same reference already exists, it will be overridden by the new object.
public with ( Nelmio\Alice\ObjectInterface $object ) : self
$object Nelmio\Alice\ObjectInterface
return self

without() public method

Creates a new instance which will no longer contain the given object.
public without ( Nelmio\Alice\FixtureInterface | Nelmio\Alice\ObjectInterface $objectOrFixture ) : self
$objectOrFixture Nelmio\Alice\FixtureInterface | Nelmio\Alice\ObjectInterface
return self