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 Application\Mvc\Router\Http; | |
use Zend\Mvc\Router\Http\Hostname as HttpHostname; | |
use Zend\Stdlib\RequestInterface as Request; | |
use Zend\Mvc\Router\Http\RouteMatch; | |
use Zend\ServiceManager\ServiceManagerAwareInterface; | |
use Zend\ServiceManager\ServiceManager; |
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
// Setup Navigation | |
$container = new Navigation(include __DIR__ . '/config/navigation.config.php'); | |
$renderer->plugin('navigation')->setContainer($container); | |
\Zend\Navigation\Page\Mvc::setDefaultRouter($e->getRouter()); |
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
$app->getEventManager()->attach(MvcEvent::EVENT_DISPATCH, array($this, 'persistEntities')); | |
public function persistEntities(MvcEvent $e) { | |
try { | |
$em = $e->getApplication()->getServiceManager()->get('doctrine.entitymanager.orm_default'); | |
$em->flush(); | |
} catch (\PDOException $exception) { | |
$e->setError('persist-error') | |
->setParam('exception', $exception); | |
$e->getApplication()->getEventManager()->trigger('dispatch.error', $e); |
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
use DoctrineORMModule\Form\Annotation\AnnotationBuilder; | |
$entity = new \Application\Entity\Account; | |
$builder = new AnnotationBuilder($this->getServiceLocator()->get('doctrine.entitymanager.orm_default')); | |
$infoForm = $builder->createForm($entity); | |
Results: | |
Fatal error: Call to undefined method Doctrine\ORM\Mapping\Column::getLength() in /home/david/domains/public_html/vendor/doctrine/doctrine-orm-module/src/DoctrineORMModule/Form/Annotation/ElementAnnotationsListener.php on line 225 | |
<?php |
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 | |
public function getServiceConfiguration() { | |
return array( | |
'factories' => array( | |
'my_identity_provider' => function($sm) { | |
$identity = $sm->get('Zend\Authentication\AuthenticationService')->getIdentity(); | |
return $identity ? $identity : Entity\Contact::ROLE_GUEST; | |
}, | |
), | |
); |
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 | |
/** | |
* Process input data and return as array based on content type | |
* support types json/xml/urlencoded form data | |
* | |
* @param Request $request | |
* @return array | |
*/ | |
public function processInput(Request $request) |
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 | |
public function setPosts(array $posts) { | |
foreach ($posts as $post) { | |
if ($this->posts->contains($post)) { | |
return; | |
} | |
$this->posts->add($post); | |
$post->setTicket($this); |
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 My\Form\Element; | |
use Zend\Form\Element\Select as SelectElement; | |
class DepartmentSelect extends SelectElement | |
{ | |
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 | |
'doctrine' => array( | |
'configuration' => array( | |
'orm_default' => array( | |
//'sqlLogger' => new \Doctrine\DBAL\Logging\EchoSQLLogger(), | |
), | |
), | |
), |
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
{ | |
"ticket": { | |
"ticketid": 174, | |
"status": "open", | |
"type": "ticket", | |
"subject": "Hello there", | |
"followup": false, | |
"contact": { | |
"contactid": 99, | |
"name": "Person", |
OlderNewer