GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Module-Texter/TexterModuleBundle.php at master · Smart-Core/Module-Texter Expand file tree/ Copy pathTexterModuleBundle.phpMore file actions 51 lines (41 loc) · 1.28 KB / Copy pathTexterModuleBundle.phpFile metadata and controls51 lines (41 loc) · 1.28 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 <?php namespace SmartCore\Module\Texter; use SmartCore\Bundle\CMSBundle\Entity\Node; use SmartCore\Bundle\CMSBundle\Module\ModuleBundle; use SmartCore\Module\Texter\Entity\TextItem; class TexterModuleBundle extends ModuleBundle { protected $adminMenuBeforeCode = '<i class="fa fa-text-height"></i>'; /** * Действие при создании ноды. * * @param Node $node */ public function createNode(Node $node) { $em = $this->container->get('doctrine.orm.entity_manager'); $item = new TextItem(); $item->setUser($this->container->get('security.token_storage')->getToken()->getUser()); $em->persist($item); $em->flush($item); $node->setParams([ 'text_item_id' => $item->getId(), 'editor' => true, ]); } /** * Действие при обновлении ноды. * * @param Node $node */ public function updateNode(Node $node) { $em = $this->container->get('doctrine.orm.entity_manager'); $item = $em->find(TextItem::class, $node->getParam('text_item_id')); if ($item) { $item->setEditor((int) $node->getParam('editor')); $em->persist($item); $em->flush($item); } } } |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |