Dumplie\Metadata\MetadataAccessRegistry::getMAO PHP Method

getMAO() public method

public getMAO ( string $typeName ) : MetadataAccessObject
$typeName string
return MetadataAccessObject
    public function getMAO(string $typeName) : MetadataAccessObject
    {
        $schema = $this->schemaBuilder->build();
        return new MetadataAccessObject($this->storage, $schema->name(), $schema->get($typeName), $this->hydrator);
    }

Usage Example

示例#1
0
 public function test_removing_metadata()
 {
     $mao = $this->registry->getMAO("product");
     $id = MetadataId::generate();
     $mao->save(new Metadata($id, "product", ["sku" => "DUMPLIE_SKU_1", "name" => "Super Product"]));
     $mao->delete($id);
     $this->assertFalse($this->storage->has("inventory", "product", (string) $id));
 }
All Usage Examples Of Dumplie\Metadata\MetadataAccessRegistry::getMAO
MetadataAccessRegistry