Check if a given attribute is a foreign key (used to reference a parent)
@param $name The attribute name
@return Boolean
@note Public in order to be callable by ObjectQuery
194352
public function isForeignKey($name) {
    $fkDescs = $this->getForeignKeyRelations();
    foreach($fkDescs as $fkDesc) {
      if ($fkDesc->getFkName() == $name) {
        return true;
      }
    }
    return false;
  }
1072544
public function is($name)
    {
        foreach ($this->roles as $role) {
            if ($role->name == $name || $role->slug == $name || $role->id == $name) {
                return true;
            }
        }

        return false;
    }
271763
public function hasMultilingualAttribute($name)
    {
        return in_array($name, $this->attributes) || array_key_exists($name, $this->_multilingualAttributes);
    }
732638
public boolean hasForeignkey(String name)
    {
        String        realName = (name == null ? "" : name);
        ForeignkeyDef def      = null;

        for (Iterator it = getForeignkeys(); it.hasNext();)
        {
            def = (ForeignkeyDef)it.next();
            if (realName.equals(def.getName()))
            {
                return true;
            }
        }
        return false;
    }
1279723
public function belongs($name, $foreignKeyOrCallback = null, $callback = null, $storeKey = null)
    {
        $foreignKey = null;
        if (func_num_args() < 4 && is_callable($foreignKeyOrCallback)) {
            $storeKey = $callback;
            $callback = $foreignKeyOrCallback;
        } else {
            $foreignKey = $foreignKeyOrCallback;
        }
        $foreignKey = $foreignKey ? : $this->rows
            ->getTable()
            ->getStructure()
            ->foreignKey($name, $this->getRows()->getTable()->getTableName());
        $relations = $this->getRows()->loadBelongRelations($name, $foreignKey, $callback, $storeKey);
        $this->loadedRelations[] = [
            $storeKey ? : $name, 'belongs', $foreignKey
        ];
        return $relations->find($this->$foreignKey);
    }
1144137
public function has($name, $foreignKeyOrCallback = null, $callback = null, $storeKey = null)
    {
        $foreignKey = null;
        if (func_num_args() < 4 && is_callable($foreignKeyOrCallback)) {
            $storeKey = $callback;
            $callback = $foreignKeyOrCallback;
        } else {
            $foreignKey = $foreignKeyOrCallback;
        }
        $foreignKey = $foreignKey ? : $this->rows
            ->getTable()
            ->getStructure()
            ->foreignKey($this->getRows()->getTable()->getTableName(), $name);
        $relations = $this->getRows()->loadHasRelations($name, $foreignKey, $callback, $storeKey);
        $this->loadedRelations[] = [
            $storeKey ? : $name, 'has', $foreignKey
        ];
        return $relations->group($foreignKey, $this->getId());
    }
443599
public function __isset($name)
    {
        if ($this->has($name, true)) {
            return true;
        } else {
            return parent::__isset($name);
        }
    }
737791
public function __isset($name)
    {
        return isset($this->children[$name]) && !is_null($this->children[$name]->getValue());
    }
893392
public function hasAttr(string $name): bool {
        return (bool)$this->collection()->reduce(function($carry, $node) use ($name) {
            if ($node->hasAttribute($name)) {
                return true;
            }

            return $carry;
        }, false);
    }
124922
public function hasDatabase($name)
    {
        foreach ($this->dbList as $db) {
            if ($db->getName() === $name) {
                return true;
            }
        }

        return false;
    }
11774
protected function doesRelationNameConflict($name)
    {
        // relationships
        $relationships = array_merge(
            $this->data['relationships']['normal'],
            $this->data['relationships']['reverse'],
            $this->data['relationships']['image'],
            $this->data['relationships']['file'],
            $this->data['relationships']['checkbox']
        );

        if (array_key_exists($name, $relationships)) return true;

        // attributes
        $attributes = array_merge(
            $this->data->normal_attributes,
            $this->data->translated_attributes
        );

        if (in_array(snake_case($name), $attributes)) return true;

        return false;
    }
1124796
public static function hasCustomfield($name = null)
    {

        $customfields = $this->getAssignedCustomfields();
        if (empty($customfields)) {
            return false;
        }
        foreach ($customfields as $customfield) {
            if ($customfield->getName() !== $name) {
                continue;
            }
            return true;
        }
        return false;
    }
557997
public function hasAttribute($name)
    {
        return
            isset($this->attributesMap[$name])
            && (
                $this->attributesMap[$name] instanceof \Closure
                || isset($this->valueObject->{$this->attributesMap[$name]})
            );
    }
1051480
public function isElementInTable(string $name): bool
    {
        $tableHash = $this->getTableHash();

        foreach ($tableHash as $item) {
            if ($item['Name'] == $name) {
                return true;
            }
        }

        return false;
    }
75702
public function getHasOneByRelationName($name)
    {
        if ($table = $this->getReferencingTable($name)) {
            if ($model = static::getModelFromTable($table)) {
                $refField = $this->getReferencingField($table, $name);

                return $this->hasOne($model, $refField);
            }
        }

        return null;
    }
1043534
public function hasProperty($name)
    {
        $result = false;

        //Handle computed properties
        if(!parent::offsetExists($name))
        {
            if(!empty($name))
            {
                $properties = $this->getComputedProperties();

                if(isset($properties[$name])) {
                    $result = true;
                }
            }
        }
        else $result = true;

        return $result;
    }
999189
protected function isRelation(string $name): bool
	{
		return method_exists(self::class, $name) === false && method_exists($this, $name);
	}