public function annotationStampUpdatedOn(AnnotationEventArgs $eventArgs) { $metadata = $eventArgs->getMetadata(); if (!isset($metadata->stamp)) { $metadata->stamp = []; } $metadata->stamp['updatedOn'] = $eventArgs->getReflection()->getName(); }
/** * * @param \Sds\DoctrineExtensions\Annotation\AnnotationEventArgs $eventArgs */ public function annotationBasicPermission(AnnotationEventArgs $eventArgs) { $annotation = $eventArgs->getAnnotation(); $metadata = $eventArgs->getMetadata(); if (!isset($metadata->permissions)) { $metadata->permissions = []; } $metadata->permissions[] = ['factory' => 'Sds\\DoctrineExtensions\\AccessControl\\BasicPermissionFactory', 'options' => ['roles' => is_array($annotation->roles) ? $annotation->roles : [$annotation->roles], 'allow' => is_array($annotation->allow) ? $annotation->allow : [$annotation->allow], 'deny' => is_array($annotation->deny) ? $annotation->deny : [$annotation->deny]]]; }
/** * * @param \Sds\DoctrineExtensions\Annotation\AnnotationEventArgs $eventArgs */ public function annotationRestCache(AnnotationEventArgs $eventArgs) { $annotation = $eventArgs->getAnnotation(); $metadata = $eventArgs->getMetadata(); if (!isset($metadata->rest)) { $metadata->rest = []; } $cache = []; if ($annotation->public) { $cache['public'] = true; } if ($annotation->private) { $cache['private'] = true; } if ($annotation->noCache) { $cache['no-cache'] = true; } if ($annotation->maxAge) { $cache['max-age'] = true; } $metadata->rest = array_merge($metadata->rest, ['cache' => $cache]); }
/** * * @param \Sds\DoctrineExtensions\Annotation\AnnotationEventArgs $eventArgs */ public function annotationFreezeThawedOn(AnnotationEventArgs $eventArgs) { $eventArgs->getMetadata()->freeze['thawedOn'] = $eventArgs->getReflection()->getName(); }
/** * * @param \Sds\DoctrineExtensions\Annotation\EventArgs $eventArgs */ public function annotationZones(AnnotationEventArgs $eventArgs) { $eventArgs->getMetadata()->zones = $eventArgs->getReflection()->getName(); }
/** * * @param \Sds\DoctrineExtensions\Annotation\AnnotationEventArgs $eventArgs */ public function annotationRoles(AnnotationEventArgs $eventArgs) { if ($eventArgs->getAnnotation()->value) { $eventArgs->getMetadata()->roles = $eventArgs->getReflection()->getName(); } }
/** * * @param \Sds\DoctrineExtensions\Annotation\AnnotationEventArgs $eventArgs */ public function annotationSoftDeleteRestoredOn(AnnotationEventArgs $eventArgs) { $eventArgs->getMetadata()->softDelete['restoredOn'] = $eventArgs->getReflection()->getName(); }
/** * * @param \Sds\DoctrineExtensions\Annotation\AnnotationEventArgs $eventArgs */ public function annotationReadonly(AnnotationEventArgs $eventArgs) { $annotation = $eventArgs->getAnnotation(); $eventArgs->getMetadata()->fieldMappings[$eventArgs->getReflection()->getName()]['readonly'] = true; }
public function annotationOwner(AnnotationEventArgs $eventArgs) { $metadata = $eventArgs->getMetadata(); $metadata->owner = $eventArgs->getReflection()->getName(); }
/** * * @param \Sds\DoctrineExtensions\Annotation\AnnotationEventArgs $eventArgs */ public function annotationDojoJsonRest(AnnotationEventArgs $eventArgs) { $annotation = $eventArgs->getAnnotation(); if ($annotation->generate) { $metadata = $eventArgs->getMetadata(); $metadata->generator[Generator\JsonRest::getResourceName($metadata->name)] = ['event' => Generator\JsonRest::event, 'options' => ['mixins' => $annotation->mixins, 'params' => $annotation->params]]; } }
/** * * @param \Sds\DoctrineExtensions\Annotation\AnnotationEventArgs $eventArgs */ public function annotationAccessControlIgnoreUpdate(AnnotationEventArgs $eventArgs) { if ($eventArgs->getAnnotation()->value) { $eventArgs->getMetadata()->accessControl['ignoreUpdate'][] = $eventArgs->getReflection()->getName(); } }
/** * * @param \Sds\DoctrineExtensions\Annotation\AnnotationEventArgs $eventArgs */ public function annotationState(AnnotationEventArgs $eventArgs) { $eventArgs->getMetadata()->state = $eventArgs->getReflection()->getName(); }
/** * * @param \Sds\DoctrineExtensions\Annotation\AnnotationEventArgs $eventArgs */ public function annotationSerializerSimpleLazy(AnnotationEventArgs $eventArgs) { $metadata = $eventArgs->getMetadata(); $this->createMetadata($metadata); $metadata->serializer['fields'][$eventArgs->getReflection()->getName()]['referenceSerializer'] = 'serializer.reference.simpleLazy'; }