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
199950
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);
    }
375442
protected function _getViewSelect($sTable, $iLang)
    {
        $oMetaData = oxNew(\OxidEsales\Eshop\Core\DbMetaDataHandler::class);
        $aFields = $oMetaData->getSinglelangFields($sTable, $iLang);
        foreach ($aFields as $sCoreField => $sField) {
            if ($sCoreField !== $sField) {
                $aFields[$sCoreField] = $sField . ' AS ' . $sCoreField;
            }
        }

        return implode(',', $aFields);
    }
262948
private function findFieldsInTableSpec($fieldName, $spec)
    {
        $fields = [];
        if(is_array($spec) && !empty($spec))
        {
            if(array_key_exists($fieldName, $spec))
            {
                $fields = $spec[$fieldName];
            }

            if(isset($spec['joins']))
            {
                foreach($spec['joins'] as $join)
                {
                    $fields = array_merge($fields, $this->findFieldsInTableSpec($fieldName, $join));
                }
            }
        }
        return $fields;
    }
538941
public function pluck($sFieldName)
    {
        if (empty($sFieldName) || $this->isEmpty()) {
            return null;
        }

        //Get all items
        $arItemList = $this->all();

        $arResult = [];
        foreach ($arItemList as $obItem) {
            if ($obItem->isEmpty()) {
                continue;
            }

            $arResult[] = $obItem->$sFieldName;
        }

        return $arResult;
    }
865202
public function GetField($Field, $Table = '') {
      if ($Table != '')
         $this->CurrentTable = $Table;
      
      if (!is_array($this->_Schema))
         $this->_Schema = array();
         
      $Result = FALSE;
      if ($this->FieldExists($this->CurrentTable, $Field) === TRUE)
         $Result = $this->_Schema[$this->CurrentTable][$Field];
         
      return $Result;
   }
440199
public function fetch($sName = null, $bMainCall = true) 
	{
		if ($this->_bIsMobile) {

			if ($sName) {

				$sMobileTpl = self::$_sBasePath.str_replace('.tpl', 'Mobile.tpl', $sName);
				if (file_exists($sMobileTpl)) { $sName = str_replace('.tpl', 'Mobile.tpl', $sName); }
			}

			if (isset($this->_aVar['model'])) {

				$sMobileTpl = self::$_sBasePath.str_replace('.tpl', 'Mobile.tpl', $this->_aVar['model']);
				if (file_exists($sMobileTpl)) { $this->_aVar['model'] = str_replace('.tpl', 'Mobile.tpl', $this->_aVar['model']); }
			}
		}

		if ($sName !== null) { $this->_sTemplateName = $sName; }

		ob_start();

		if (file_exists(self::$_sBasePath . $this->_sTemplateName)) {

			$iFileModificationTime = filemtime(self::$_sBasePath . $this->_sTemplateName);
		}
		else {
			//faire une erreur
		}

		if (file_exists(self::$_sCachePath.$this->_getEncodeTemplateName($this->_sTemplateName).'.cac.php')) {

			$iCacheModificationTime = filemtime(self::$_sCachePath.$this->_getEncodeTemplateName($this->_sTemplateName).'.cac.php');
		}
		else {

			$iCacheModificationTime = 0;
		}

		if ($iCacheModificationTime < $iFileModificationTime) {

			$sTemplate = file_get_contents(self::$_sBasePath.$this->_sTemplateName);
			$this->_transform($sTemplate, $this->_sTemplateName, $bMainCall, true);
		}
		else {

			$sTemplate = file_get_contents(self::$_sBasePath.$this->_sTemplateName);
			$this->_transform($sTemplate, $this->_sTemplateName, $bMainCall, false);
		}

		return ob_get_clean();
	}
597206
public function hasField($field)
    {
        $schema = static::getSchema();
        return (
            array_key_exists($field, $this->record)
            || array_key_exists($field, $this->components)
            || $schema->fieldSpec(static::class, $field)
            || $schema->unaryComponent(static::class, $field)
            || $this->hasMethod("get{$field}")
        );
    }
364437
protected function _getViewJoinAll($sTable)
    {
        $sJoin = ' ';
        $oMetaData = oxNew(\OxidEsales\Eshop\Core\DbMetaDataHandler::class);
        $aTables = $oMetaData->getAllMultiTables($sTable);
        if (count($aTables)) {
            foreach ($aTables as $sTableKey => $sTableName) {
                $sJoin .= "LEFT JOIN {$sTableName} USING (OXID) ";
            }
        }

        return $sJoin;
    }
658316
public BaseField getField(String strTableName, int iFieldSeq)   // Lookup this field
    {
        if (this.getRecord(strTableName) != this)
            return null;
        return this.getField(iFieldSeq);
    }
1306909
protected function checkFieldChanges($sField, $obListStore)
    {
        if (empty($sField) || empty($obListStore) || !$this->isFieldChanged($sField)) {
            return;
        }

        if ($obListStore instanceof AbstractStoreWithoutParam) {
            $obListStore->clear();
        } elseif ($obListStore instanceof AbstractStoreWithParam) {
            $obListStore->clear($this->obElement->$sField);
            $obListStore->clear($this->obElement->getOriginal($sField));
        }
    }
1161339
public function getColumnContent($gridField, $record, $columnName) {
        if(!$record->canView()) return;

        $field = GridField_FormAction::create($gridField, 'ExportSingle'.$record->ID, false,
                "exportsingle", array('RecordID' => $record->ID))
            ->addExtraClass('gridfield-button-export-single no-ajax')
            ->setAttribute('title', _t('firebrandhq.EXCELEXPORT', "Export"))
            ->setAttribute('data-icon', 'download-csv');
        return $field->Field();
    }
602211
function FetchField($fieldOffset = -1)
	{

		$off=$fieldOffset+1; // offsets begin at 1

		$o= new ADOFieldObject();
		$o->name = @odbc_field_name($this->_queryID,$off);
		$o->type = @odbc_field_type($this->_queryID,$off);
		$o->max_length = @odbc_field_len($this->_queryID,$off);
		if (ADODB_ASSOC_CASE == 0) $o->name = strtolower($o->name);
		else if (ADODB_ASSOC_CASE == 1) $o->name = strtoupper($o->name);
		return $o;
	}
1154984
public BaseField getField(String strTableName, String strFieldName)     // Lookup this field
    {
        if (this.getRecord(strTableName) != this)
            return null;
        return this.getField(strFieldName);
    }
684982
public function getField(string $field)
    {
        if (isset($this->_record[$field]))
            return $this->_record[$field];
        return null;
    }
911577
public function getDistinctResult($selectField = '*')
    {
        try {
            $result = $this->db->setQueryOption(['DISTINCT'])->get($this->table, NULL, $selectField);
            $this->debug->debug(__FUNCTION__, 'Result from DB => ' . json_encode($result));

            return $result;
        }
        catch (\Exception $e) {
            $this->debug->error(__FUNCTION__, $e->getFile() . ' - Line: ' . $e->getLine() . ' - Message: ' . $e->getMessage());

            return NULL;
        }
    }
1045057
protected function _getObjectField($sId, $sObject, $sField)
    {
        if (!$sId) {
            return '';
        }
        $oObj = oxNew($sObject);
        if ($oObj->load($sId)) {
            return $oObj->$sField->value;
        }

        return '';
    }
51059
public function getField($name) {
    if (isset($this->fields[$name])) {
      return $this->record[$name];
    }

    if (isset($this->fetchedRecord[$name])) {
      return $this->fetchedRecord[$name];
    }

    throw new \Exception('Not a valid Field for Get ' . $name);
  }