eZ\Publish\Core\Persistence\Legacy\Content\Mapper::extractRelationFromRow PHP Method

extractRelationFromRow() protected method

Extracts a Relation object from a $row.
protected extractRelationFromRow ( array $row ) : eZ\Publish\SPI\Persistence\Content\Relation
$row array Associative array representing a relation
return eZ\Publish\SPI\Persistence\Content\Relation
    protected function extractRelationFromRow(array $row)
    {
        $relation = new Relation();
        $relation->id = (int) $row['ezcontentobject_link_id'];
        $relation->sourceContentId = (int) $row['ezcontentobject_link_from_contentobject_id'];
        $relation->sourceContentVersionNo = (int) $row['ezcontentobject_link_from_contentobject_version'];
        $relation->destinationContentId = (int) $row['ezcontentobject_link_to_contentobject_id'];
        $relation->type = (int) $row['ezcontentobject_link_relation_type'];
        $contentClassAttributeId = (int) $row['ezcontentobject_link_contentclassattribute_id'];
        if ($contentClassAttributeId > 0) {
            $relation->sourceFieldDefinitionId = $contentClassAttributeId;
        }
        return $relation;
    }