ApiPlatform\SchemaGenerator\GoodRelationsBridge::extractCardinality PHP Method

extractCardinality() public method

Extracts cardinality from the Good Relations OWL.
public extractCardinality ( string $id ) : string | boolean
$id string
return string | boolean
    public function extractCardinality($id)
    {
        foreach ($this->relations as $relation) {
            $result = $relation->xpath(sprintf('//*[@rdf:about="%s"]/rdfs:label', $this->getPropertyUrl($id)));
            if (count($result)) {
                preg_match('/\\(.\\.\\..\\)/', $result[0]->asXML(), $matches);
                return $matches[0];
            }
        }
        return false;
    }