Created
May 29, 2012 14:54
-
-
Save mikeemoo/2828875 to your computer and use it in GitHub Desktop.
LoadContentPageData
This file contains hidden or 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 Lowpress\ExampleBundle\DataFixtures\ORM; | |
| use Doctrine\Common\Persistence\ObjectManager; | |
| use Doctrine\Common\DataFixtures\AbstractFixture; | |
| use Doctrine\Common\DataFixtures\OrderedFixtureInterface; | |
| use Lowpress\ExampleBundle\Entity\ContentPage; | |
| class LoadContentPageData extends AbstractFixture implements OrderedFixtureInterface | |
| { | |
| public function load(ObjectManager $manager) | |
| { | |
| $contentpage = new ContentPage(); | |
| $contentpage->setPageTitle('My Content Page Title'); | |
| $contentpage->setUrl('my/content/page'); | |
| $contentpage->setMetaKeywords('my, content page, keywords'); | |
| $contentpage->setMetaDescription('my content page description'); | |
| $contentpage->setContent('content for page 1'); | |
| $contentpage->setSite($manager->merge($this->getReference('site-one'))); | |
| $manager->persist($contentpage); | |
| $manager->flush(); | |
| } | |
| public function getOrder() | |
| { | |
| return 3; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment