×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Algirdas Gr
Added: Jun 18, 2014 6:14 AM
Modified: Jun 18, 2014 6:17 AM
Views: 17
Tags: block symfony cmf
http://symfony.com/doc/current/cmf/reference/configuration/block.html
  1. use Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\SimpleBlock;
  2.  
  3. /** @var $dm \Doctrine\ODM\PHPCR\DocumentManager */
  4. $parentDocument = $dm->find(null, '/cms/content');
  5.  
  6. $myBlock = new SimpleBlock();
  7. $myBlock->setParentDocument($parentDocument);
  8. $myBlock->setName('sidebarBlock');
  9. $myBlock->setTitle('My first block');
  10. $myBlock->setBody('Hello block world!');
  11.  
  12. $documentManager->persist($myBlock);