/** * @param $value string * @param $property Reflection_Property */ public function __construct($value, Reflection_Property $property) { $possibles = [self::ALL, self::COLLECTION, self::DATETIME, self::MAP, self::OBJECT]; if (empty($value) && $property->getType()->isClass() && ($stored = $property->getFinalClass()->getAnnotation('stored')->value)) { $value = $this->guessValue($property); } if (!empty($value) && !in_array($value, $possibles)) { trigger_error('@link ' . $value . ' is a bad value : only ' . join(', ', $possibles) . ' can be used', E_USER_ERROR); $value = ''; } parent::__construct($value); }
/** * @param $value string * @param $property Reflection_Property ie the contextual Reflection_Property object */ public function __construct($value, Reflection_Property $property) { parent::__construct($value); if (empty($this->value)) { foreach ($property->getFinalClass()->getAnnotations('group') as $group) { /** @var $group Class_\Group_Annotation */ if ($group->has($property->getName())) { $this->value = $property->getName(); break; } } } }