Created
September 1, 2016 23:16
-
-
Save simshaun/906cf9949b6ee821ceb0845307b14a20 to your computer and use it in GitHub Desktop.
Alice Doctrine ArrayCollection data provider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace AppBundle\DataFixtures\Faker; | |
use Doctrine\Common\Collections\ArrayCollection; | |
class ArrayCollectionProvider | |
{ | |
public function ArrayCollection($elements) | |
{ | |
return new ArrayCollection($elements); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
alice.provider.array_collection: | |
class: AppBundle\DataFixtures\Faker\ArrayCollectionProvider | |
tags: | |
- { name: hautelook_alice.faker.provider } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Entity\AdSpot: | |
adspot_foo: | |
name: 'Foo' | |
adspot_bar: | |
name: 'Bar' | |
Entity\Ad: | |
ad_1: | |
name: 'FPO 1' | |
spots: <ArrayCollection([@adspot_foo, @adspot_bar])> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment