Doctrine_Record::contains PHP Méthode

contains() public méthode

test whether a field (column, mapped value, related component) is accessible by @see get()
public contains ( string $fieldName ) : boolean
$fieldName string
Résultat boolean
    public function contains($fieldName)
    {
        if (array_key_exists($fieldName, $this->_data)) {
            // this also returns true if the field is a Doctrine_Null.
            // imho this is not correct behavior.
            return true;
        }
        if (isset($this->_id[$fieldName])) {
            return true;
        }
        if (isset($this->_values[$fieldName])) {
            return true;
        }
        if (isset($this->_references[$fieldName]) && $this->_references[$fieldName] !== self::$_null) {
            return true;
        }
        return false;
    }