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 Application\Entity; | |
| use Doctrine\ORM\Mapping as ORM; | |
| use Doctrine\Common\Collections\ArrayCollection; | |
| /** | |
| * Application\Entity\Mandator | |
| * |
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
| START TRANSACTION | |
| DELETE FROM `milestone` WHERE `milestone_id` = ? | |
| array(1) { [0]=> int(13) } array(1) { [0]=> string(7) "integer" } | |
| DELETE FROM `milestone` WHERE `milestone_id` = ? | |
| array(1) { [0]=> int(14) } array(1) { [0]=> string(7) "integer" } | |
| DELETE FROM `event` WHERE `event_id` = ? | |
| array(1) { [0]=> int(14) } array(1) { [0]=> string(7) "integer" } |
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
| $this->add( | |
| array( | |
| 'type' => 'DoctrineModule\Form\Element\ObjectSelect', | |
| 'name' => 'field_id', | |
| 'options' => array( | |
| 'object_manager' => $em, | |
| 'target_class' => 'Application\Entity\Field', | |
| 'label_generator' => function($targetEntity) { | |
| return $targetEntity->getName(); | |
| }, |
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
| $hydra = new DoctrineHydrator($sm->get('Doctrine\ORM\EntityManager', false)); | |
| $hydra->addStrategy('date_start', new \cwdCommon\Doctrine\Strategy\DateTime()); | |
| $hydra->addStrategy('date_end', new \cwdCommon\Doctrine\Strategy\DateTime()); | |
| $this->setHydrator($hydra); | |
| $this->setObject(new \Application\Entity\Event()); | |
| $this->add( | |
| array( | |
| 'name' => 'date_start', |
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 Application\Form; | |
| use DoctrineORMModule\Stdlib\Hydrator\DoctrineEntity as DoctrineHydrator; | |
| use Zend\Form\Form; | |
| use Zend\ServiceManager\ServiceManager; | |
| class Event extends Form | |
| { | |
| public function __construct($fields, $calendar, ServiceManager $sm) |
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 Admin\Entity; | |
| use Doctrine\ORM\Mapping as ORM; | |
| use Doctrine\Common\Collections\ArrayCollection; | |
| /** | |
| * Admin\Entity\Article | |
| * |
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 cwdCommon\Validator; | |
| use Zend\Validator\AbstractValidator; | |
| class UID extends AbstractValidator | |
| { | |
| const INVALID = 'invalid'; | |
| const OTHER = 'other'; |
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
| return array( | |
| 'router' => array( | |
| 'routes' => array( | |
| 'admin' => array( | |
| 'type' => 'Segment', | |
| 'options' => array( | |
| 'route' => '/admin[/[:controller[/[:action]]]]', | |
| 'constraints' => array( | |
| 'controller' => '[a-zA-Z][a-zA-Z0-9_-]*', | |
| 'action' => '[a-zA-Z][a-zA-Z0-9_-]*' |
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
| echo '<pre>'; | |
| var_dump($adverts[0]); | |
| \Doctrine\Common\Util\Debug::dump($adverts[0]); | |
| echo '</pre>'; | |
| array | |
| 0 => | |
| array | |
| 'advertId' => int 14 |
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
| $query = $this->getEntityManager()->createQuery('SELECT a, count(a.advertId) as amount | |
| FROM Admin\Entity\Advert a | |
| WHERE a.fordate >= :date | |
| AND a.publication IN (:publications) | |
| GROUP By a.advertType, a.publication, a.fordate, a.created | |
| ORDER By a.fordate'); | |
| $query->setParameters(array( | |
| 'date' => date('Y-m-d', $week['to']), | |
| 'publications' => implode(',', $publications) |