Last active
August 29, 2015 14:09
-
-
Save alihammad-gist/d4f364ec543b5b135a4d to your computer and use it in GitHub Desktop.
Formatting errors chained methods #1
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 Appointment\InputFilter; | |
use Appointment\Entity\Appointment as AppointmentEntity; | |
use Zend\InputFilter\Factory as InputFilterFactory; | |
use Zend\ServiceManager\FactoryInterface; | |
class AppointmentFactory implements FactoryInterface | |
{ | |
public function createService(ServiceLocatorInterface $serviceLocator) | |
{ | |
$iFactory = new InputFilterFactory(); | |
$inputFilter = $iFactory->createInputFilter(array( | |
'date' => array( | |
'required' => true, | |
'validators' => array( | |
array( | |
'name' => 'date', | |
), | |
), | |
'filters' => array( | |
array('name' => 'trim'), | |
) | |
), | |
'status' => array( | |
'required' => true, | |
'validators' => array( | |
array( | |
'name' => 'inarray', | |
'options' => array( | |
'haystack' => array_values(AppointmentEntity::getStatuses()), | |
) | |
) | |
) | |
), | |
'patient' => array( | |
'required' => true, | |
'validators' => array( | |
array( | |
'name' => 'DoctrineModule\Validator\ObjectExists', | |
'options' => array( | |
'object_repository' => $serviceLocator->getServiceLocator()->get('Doctrine\ORM\EntityManager')->getRepository('Appointment\Entity\Appointment'), | |
'fields' => 'id', | |
) | |
) | |
), | |
), | |
'doctor' => array( | |
'requried' => true, | |
'validators' => array( | |
'name' => 'DoctrineModule\Validator\ObjectExists', | |
'options' => array( | |
'object_repository' => $serviceLocator->getServiceLocator() | |
->get('Doctrine\ORM\EntityManager') ->getRepository('Staff\Entity\Staff'), | |
'fields' => 'id', | |
) | |
) | |
) | |
)); | |
} | |
} |
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 Appointment\InputFilter; | |
use Appointment\Entity\Appointment as AppointmentEntity; | |
use Zend\InputFilter\Factory as InputFilterFactory; | |
use Zend\ServiceManager\FactoryInterface; | |
class AppointmentFactory implements FactoryInterface | |
{ | |
public function createService(ServiceLocatorInterface $serviceLocator) | |
{ | |
$iFactory = new InputFilterFactory(); | |
$inputFilter = $iFactory->createInputFilter(array( | |
'date' => array( | |
'required' => true, | |
'validators' => array( | |
array( | |
'name' => 'date', | |
), | |
), | |
'filters' => array( | |
array('name' => 'trim'), | |
) | |
), | |
'status' => array( | |
'required' => true, | |
'validators' => array( | |
array( | |
'name' => 'inarray', | |
'options' => array( | |
'haystack' => array_values(AppointmentEntity::getStatuses()), | |
) | |
) | |
) | |
), | |
'patient' => array( | |
'required' => true, | |
'validators' => array( | |
array( | |
'name' => 'DoctrineModule\Validator\ObjectExists', | |
'options' => array( | |
'object_repository' => $serviceLocator->getServiceLocator()->get('Doctrine\ORM\EntityManager')->getRepository('Appointment\Entity\Appointment'), | |
'fields' => 'id', | |
) | |
) | |
), | |
), | |
'doctor' => array( | |
'requried' => true, | |
'validators' => array( | |
'name' => 'DoctrineModule\Validator\ObjectExists', | |
'options' => array( | |
'object_repository' => $serviceLocator->getServiceLocator() | |
->get('Doctrine\ORM\EntityManager')->getRepository('Staff\Entity\Staff'), | |
'fields' => 'id', | |
) | |
) | |
) | |
)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment