eZ\Publish\Core\FieldType\Image\ImageStorage\Gateway\LegacyStorage::storeImageReference PHP Method

storeImageReference() public method

Stores a reference to the image in $path for $fieldId.
public storeImageReference ( string $uri, mixed $fieldId )
$uri string File IO uri (not legacy)
$fieldId mixed
    public function storeImageReference($uri, $fieldId)
    {
        // legacy stores the path to the image without a leading /
        $path = $this->redecorator->redecorateFromSource($uri);
        $connection = $this->getConnection();
        $insertQuery = $connection->createInsertQuery();
        $insertQuery->insertInto($connection->quoteTable('ezimagefile'))->set($connection->quoteColumn('contentobject_attribute_id'), $insertQuery->bindValue($fieldId, null, \PDO::PARAM_INT))->set($connection->quoteColumn('filepath'), $insertQuery->bindValue($path));
        $statement = $insertQuery->prepare();
        $statement->execute();
    }