source/Core/UtilsPic.php
protected function fetchIsImageDeletable($sPicName, $sTable, $sField)
    {
        // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804).
        $masterDb = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster();

        $query = "select count(*) from $sTable where $sField = " . $masterDb->quote($sPicName) . " group by $sField ";

        return $masterDb->getOne($query);
    }
protected function fetchIsImageDeletable($sPicName, $sTable, $sField)
    {
        // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804).
        $masterDb = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster();

        $query = "select count(*) from $sTable where $sField = " . $masterDb->quote($sPicName) . " group by $sField ";

        return $masterDb->getOne($query);
    }
protected function fetchIsImageDeletable ( $ sPicName , $ sTable , $ sField ) { // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804). $ masterDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getMaster ( ) ; $ query = "select count(*) from $sTable where $sField = " . $ masterDb -> quote ( $ sPicName ) . " group by $sField " ; return $ masterDb -> getOne ( $ query ) ; }
Fetch the information, if the given image is deletable from the database.

@param string $sPicName Name of image file.
@param string $sTable   The table in which we search for the image.
@param string $sField   The value of the table field.

@return mixed
Fetch the information if the given image is deletable from the database .