getEntityMetadata() публичный Метод

Get the metadata for an entity, including column information
public getEntityMetadata ( string | object $entity ) : Entity
$entity string | object Entity or class name of the entity
Результат Bravo3\Orm\Mappers\Metadata\Entity
Пример #1
0
 public function testStuff()
 {
     $mapper = new AnnotationMapper();
     $product = new Product();
     $product_meta = $mapper->getEntityMetadata(Reader::getEntityClassName($product));
     $this->assertEquals("products", $product_meta->getTableName());
     $bad = new BadEntity();
     $bad_meta = $mapper->getEntityMetadata(Reader::getEntityClassName($bad));
     $this->assertEquals("bad_entity", $bad_meta->getTableName());
 }
Пример #2
0
 /**
  * @expectedException \Bravo3\Orm\Exceptions\InvalidEntityException
  */
 public function testIllegalEntity()
 {
     $mapper = new AnnotationMapper();
     $entity = new VeryBadEntity();
     $mapper->getEntityMetadata($entity);
 }