public function testGetTagFromProperty() { $this->assertEmpty(AnnotationReader::getPropertyValue($this->class, $this->prop, 'tagwithoutvalue')); $this->assertEmpty(AnnotationReader::getPropertyValue($this->class, $this->prop, 'notatag')); $this->assertEmpty(AnnotationReader::getPropertyValue($this->class, $this->prop, 'nonexisting')); $this->assertEquals(AnnotationReader::getPropertyValue($this->class, $this->prop, 'tagwithvalue'), 'value'); }
private function getTable() { $class = get_class($this); $table = AnnotationReader::getClassValue($class, 'table'); if (!$table) { throw new ModelException('Missing @table definition on class: ' . $class); } return $table; }
public function isValid($class, $property) { // @todo depends on annotation reader, add di return AnnotationReader::hasPropertyTag($class, $property, 'primary-key'); }