Map property relatives to appropriate objects.

@return array|bool
487092
public function mapRelatives()
    {
        $relations = collect($this->relations());

        if ($relations->isEmpty()) {
            return false;
        }

        return $this->items = collect($this->all())
            ->map(function ($value, $key) use ($relations) {
                if ($relations->has($key)) {
                    $className = $relations->get($key);

                    return new $className($value);
                }

                return $value;
            })
            ->all();
    }
79493
public function getProperties()
    {
        $properties = new BeanPropertyCollection();

        // Properties already taken into account accross the hierarchy.
        $registeredProperties = array();
        $target = $this->getClass();

        while ($target) {

            foreach ($target->getProperties() as $prop) {

                $propName = $prop->getName();

                if ($this->isPropertyAnnotated($propName) === true && in_array($propName, $registeredProperties) === false) {
                    $properties[] = new BeanProperty($target->getName(), $propName);
                    $registeredProperties[] = $propName;
                }
            }

            $target = $target->getParentClass();
        }

        return $properties;
    }
44859
public function getComputedProperties()
    {
        $result = array();

        if($row = $this->getIterator()->current()) {
            $result = $row->getComputedProperties();
        }

        return $result;
    }
334169
public function getPersistentFields()
    {
        if (empty($this->persistentFields)) {

            $persistentFields = $this->getPropertyContainer()->getFields('hasMany');
            if (!empty($persistentFields)) {
                $persistentFields = array_filter(
                    $persistentFields,
                    function (PropertyContract $property) {
                        if (!$property->getBehavior()->isPersistent()) {
                            return false;
                        }

                        if (!$property->getBehavior() instanceof IntegerBehavior) {
                            return true;
                        }

                        if ($property->getBehavior()->getIncrementalBehavior() == 'database') {
                            return false;
                        }

                        return true;
                    }
                );
            }
            $this->persistentFields = $persistentFields;
        }

        return $this->persistentFields;
    }
1235577
public function getProperties() {
    $properties = array();
    foreach ($this->properties as $property) {
      if ($property->getDeclaringClass() instanceof GClass && 
          $property->getDeclaringClass()->equals($this)) {
        $properties[$property->getName()] = $property;
      }
    }
    return $properties;
  }
176884
public function getAncestors()
    {
        $ancestors = new Collection();

        $ancestor = $this;

        while (($ancestor = $ancestor->parent) && !$ancestors->contains($ancestor)) {
            $ancestors->push($ancestor);
            break;
        }

        return $ancestors;
    }
1290536
public function getProperties()
    {
        if ($this->properties === null) {
            // lazy load class properties list
            $this->properties = array();
            foreach ($this->node->stmts as $stmt) {
                if ($stmt instanceof Node\Stmt\Property) {
                    $this->properties[] = new PropertyModel($this, $stmt);
                }
            }
        }
        return array_values($this->properties);
    }
875367
public function getAllProperties()
    {
        $props = array();
        foreach ($this->dynamic as $k => $c) {
            $props[$k] = $c();
        }

        return array_replace($props, $this->properties);
    }
643212
public function get_ancestors() {
        global $DB;
        $ancestors = array();
        $ancestorsids = explode('/', trim($this->get('path'), '/'));
        // Drop the root item from the array /0/.
        array_shift($ancestorsids);
        if (!empty($ancestorsids)) {
            list($insql, $params) = $DB->get_in_or_equal($ancestorsids, SQL_PARAMS_NAMED);
            $ancestors = self::get_records_select("id $insql", $params);
        }
        return $ancestors;
    }
84989
public function getOldRelations()
    {
        $oldRelations = [];
        foreach ($this->_relations as $relationName) {
            $oldRelations[$relationName] = $this->getOldRelation($relationName);
        }
        return $oldRelations;
    }
1284152
public function __getSerialisablePropertyMap()
    {

        $serialisableProperties = parent::__getSerialisablePropertyMap();
        $dynamicProperties = $this->__dynamicPropertyMap;

        $map = array();
        foreach ($dynamicProperties as $key => $value) {
            $map[$key] = $value;
        }
        foreach ($serialisableProperties as $key => $value) {
            $map[$key] = $value;
        }

        // Merge our dynamic properties in and return.
        return $map;

    }
543146
public function getUniqueProperties()
    {
        $props = [];
        foreach ($this->properties as $property) {
            if ($property->isUnique()) {
                $props[] = $property;
            }
        }

        return $props;
    }
1134863
protected function buildPropertyMap()
    {
        $map = [];
        $properties = (new ReflectionObject($this))->getProperties(ReflectionProperty::IS_PUBLIC);

        foreach ($properties as $property) {
            $map[$property->getName()] = $property;
        }

        return $map;
    }
649563
public function getForeignColumnObjects()
    {
        $columns = [];
        $foreignTable = $this->getForeignTable();
        foreach ($this->foreignColumns as $columnName) {
            $column = $foreignTable->getColumn($columnName);
            if (null !== $column) {
                $columns[] = $column;
            }
        }

        return $columns;
    }
631285
public function getRelations()
    {
        if (empty($this->_relations)) {
            $properties = $this->getInspector()->getClassProperties();
            foreach ($properties as $property) {
                $annotations = $this->getInspector()
                    ->getPropertyAnnotations($property);
                foreach (static::$_annotations as $name => $class) {
                    if ($annotations->hasAnnotation($name)) {
                        $this->_relations[$property] = call_user_func_array(
                            [$class, 'create'],
                            [
                                $annotations->getAnnotation($name),
                                $this->getEntity(),
                                trim($property, '_')
                            ]
                        );
                        break;
                    }
                }
            }
        }
        return $this->_relations;
    }
1314283
public function mapTo($property)
    {
        if (!$this->mappingTo) {
            $this->mappingTo = array_flip($this->mapping);
        }

        return isset($this->mappingTo[$property]) ? $this->mappingTo[$property] : $property;
    }
1273627
public function automap() {
        $map = array();

        // Shallow copy.
        $collectionfrom = $this->get_collection_from();
        $collectionto = $this->get_collection_to();

        // Find mappings.
        foreach ($collectionfrom as $keyfrom => $compfrom) {
            foreach ($collectionto as $keyto => $compto) {
                if ($compfrom->get('idnumber') == $compto->get('idnumber')) {
                    $map[$compfrom->get('id')] = $compto->get('id');
                    unset($collectionfrom[$keyfrom]);
                    unset($collectionto[$keyto]);
                    break;
                }
            }
        }

        $this->mappings = $map;
    }