Example #1
0
 /**
  * Get the type information by (full) RDF name
  *
  * @param string $rdf
  *
  * @return TypeInterface
  */
 public function getTypeByRdf($rdf)
 {
     $map = $this->driver->getAllNames();
     if (!isset($map[$rdf])) {
         throw new TypeNotFoundException("No type for {$rdf}");
     }
     return $this->getTypeByName($map[$rdf]);
 }
Example #2
0
 /**
  * Gets the names of all revs known to this type.
  *
  * @return array The names of all revs known to this type.
  */
 public function testGetRevOptions()
 {
     $mapper = $this->getMock('Midgard\\CreatePHP\\RdfMapperInterface');
     $typeFactory = $this->getMockBuilder('Midgard\\CreatePHP\\Metadata\\RdfTypeFactory')->disableOriginalConstructor()->getMock();
     $type = $this->driver->loadType('Test\\Midgard\\CreatePHP\\Model', $mapper, $typeFactory);
     $revs = array('dcterms:partOf' => 'dcterms:partOf');
     $this->assertEquals($revs, $type->getRevOptions());
 }