3 namespace Doctrine\Tests\Common\Annotations\Fixtures;
5 use Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll;
6 use Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAnnotation;
9 * @AnnotationTargetAll("Foo")
11 final class ClassWithClosure
15 * @AnnotationTargetAll(@AnnotationTargetAnnotation)
21 * @AnnotationTargetAll(@AnnotationTargetAnnotation)
23 * @param \Closure $callback
26 public function methodName(\Closure $callback)
29 return function() use ($self, $callback) {
35 * @param integer $year
36 * @param integer $month
38 * @return \Doctrine\Common\Collections\ArrayCollection
40 public function getEventsForDate($year, $month, $day){
41 $extractEvents = null; // check if date of item is inside day given
42 $extractEvents = $this->events->filter(function ($item) use ($year, $month, $day) {
43 $leftDate = new \DateTime($year.'-'.$month.'-'.$day.' 00:00');
44 $rigthDate = new \DateTime($year.'-'.$month.'-'.$day.' +1 day 00:00');
45 return ( ( $leftDate <= $item->getDateStart() ) && ( $item->getDateStart() < $rigthDate ) );
49 return $extractEvents;