Esempio n. 1
0
 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');
 }
Esempio n. 2
0
 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;
 }
Esempio n. 3
0
 public function isValid($class, $property)
 {
     // @todo depends on annotation reader, add di
     return AnnotationReader::hasPropertyTag($class, $property, 'primary-key');
 }