Get relationship

@param  string $name
@return AbstractRelationship
772725
public function getRelationship(string $name): AbstractRelationship
    {
        if (isset($this->relationships[$name])) {
            return $this->relationships[$name];
        }

        throw new RelationshipNotFoundException($this, $name);
    }
698273
public function hasRelation($name)
    {
        $name = $this->prepareRelationName($name);

        return key_exists($name, $this->relations);
    }
725002
public function getRelationship($name)
    {
        // If relationship does not exist throw an exception
        if ( ! $this->isRelationship($name)) {
            $exception = new ModelNotFoundException();
            $exception->setModel($name);
            throw $exception;
        }

        return $this->relationships[$name];
    }
1073636
public function relation($name)
    {
        if (isset($this->_relationships[$name])) {
            return $this->_relationships[$name];
        }
        if (!isset($this->_relations[$name])) {
            throw new ORMException("Relationship `{$name}` not found.");
        }
        $config = $this->_relations[$name];
        $relationship = $config['relation'];
        unset($config['relation']);

        $relation = $this->_classes[$relationship];
        return $this->_relationships[$name] = new $relation($config + [
            'name'        => $name,
            'conventions' => $this->_conventions
        ]);
    }
493621
public function get($name)
    {
        if (strpos($name, '.')) {
            $names = explode('.', $name);
            $node = $this;

            foreach ($names as $n) {
                if ($node instanceof self && property_exists($node, $n)) {
                    $node = $node->$n;
                } else {
                    if ($this->isStrict()) {
                        exit("Stored data don't exists node '$n'\n");
                    }

                    $node = null;
                    break;
                }
            }

            return $node;
        }

        return property_exists($this, $name) ? $this->$name : null;
    }
166003
public function get($name = null, $default = null)
     {
         $description = $this->getEntityDescription();

        //get the property
        $property = $description->getProperty($name);

         if (!$property) {
             return parent::get($name, $default);
         }

        //get the property name
        $name = $property->getName();

         $value = $this->_data->offsetGet($name);

         if ($property->isRelationship() && $property->isOneToMany() && is_null($value)) {
             //since it's an external relationship
            //lets instantitate a dummy relationship
            //this should happen for the one-to-one relationships
            if ($property->isOneToOne()) {
                return;
            }

             $value = $this->_data[$name] = $property->getSet($this);

             return $value;
         }

         return is_null($value) ? $default : $value;
     }
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;
    }
174155
public function getRelatedField($name)
    {
        $field = $this->getField($name);

        return $field instanceof RelatedField ? $field : null;
    }
1167719
public function getAttribute($name)
    {
        $name = $this->convertToPrimaryKeyName($name);

        if ($this->hasAttribute($name)) {
            return $this->attributes->getAttribute($name);
        } elseif (isset($this->related[$name])) {
            return $this->related[$name];
        }
    }
1022463
public function getRelation($name)
    {
        $relation = false;
        if ($this->isRelation($name)) {
            $relation =  $this->getRelations()[$name];
        }
        return $relation;
    }
826563
public function getConnection($name)
    {
        if (!$this->connectionSettings->has($name)) {
            throw new BadArgumentException('Connection with name ":name" not defined in configuration file ":file"', [
                'name' => $name, 'file' => ServiceLocator::instance()->getConfiguration()->getIdentity(),
            ]);
        }
        
        $this->connect($name);
        
        return static::$connections[$name];
    }
531491
protected function getRelation($name)
    {
        $relation = $this->relations[$name];
        if ($relation instanceof self || (\is_array($relation) && $relation[0] instanceof self)) {
            return $relation;
        }

        $class = 'App\\Model\\' . $relation[1];
        /** @var Model $model */
        $model = new $class();

        switch ($relation[0]) {
            case self::HAS_ONE:
                $this->relations[$name] = $model->eq($relation[2], $this->__get($this->primary))->get();
                break;
            case self::HAS_MANY:
                $this->relations[$name] = $model->eq($relation[2], $this->__get($this->primary))->select();
                break;
            case self::BELONGS_TO:
                $this->relations[$name] = $model->get($this->__get($relation[2]));
                break;
            default:
                throw new ModelException("Relation $name not found.");
        }

        return $this->relations[$name];
    }
1141060
public function get($name) {

		if ( array_key_exists( $name, $this->_properties )) {
			return $this->_properties[$name];

		} else if ( isset($this->$name) ) {
			return $this->$name;
		}

		return null;
	}
710916
public function getRelationIds($name)
    {
        if (!$this->isRelation($name, false)) {
            throw new UnknownPropertyException('Getting unknown relation: ' . get_called_class() . '::' . $name);
        }

        if (!$this->values->has($name)) {
            $this->values->set($name, $this->getLinkedIds($name));
        }

        return $this->values->get($name);
    }
95553
private function getRelationFromDb($name)
    {
        if (!$this->relationsParser) {
            $this->relationsParser = RelationsParser::parse(get_class($this), new ModelCondition(['model' => get_class($this)]), '*');
        }
        return $this->relationsParser->getForSingleModel($this, $name);
    }
443223
public function fetch($name)
    {
        return $this->get($name, function($instance, $name) {
            $collection = [$instance];
            $this->schema()->embed($collection, $name);
            return isset($this->_data[$name]) ? $this->_data[$name] : null;
        });
    }
1351443
public function &__get($name) {
    if ($name === 'guid') {
      return $this->$name;
    }
    if ($this->isASleepingReference) {
      $this->referenceWake();
    }
    if ($name === 'cdate'
        || $name === 'mdate'
        || $name === 'tags'
      ) {
      return $this->$name;
    }
    // Unserialize.
    if (isset($this->sdata[$name])) {
      $this->data[$name] = unserialize($this->sdata[$name]);
      unset($this->sdata[$name]);
    }
    // Check for an entity first.
    if (isset($this->entityCache[$name])) {
      if ($this->data[$name][0] === 'nymph_entity_reference') {
        if ($this->entityCache[$name] === 0) {
          // The entity hasn't been loaded yet, so load it now.
          $className = $this->data[$name][2];
          if (!class_exists($className)) {
            throw new Exceptions\EntityCorruptedException(
                "Entity reference refers to a class that can't be found, ".
                "$className."
            );
          }
          $this->entityCache[$name] =
              $className::factoryReference($this->data[$name]);
          $this->entityCache[$name]->useSkipAc($this->useSkipAc);
        }
        return $this->entityCache[$name];
      } else {
        throw new Exceptions\EntityCorruptedException(
            "Entity data has become corrupt and cannot be determined."
        );
      }
    }
    // Check if it's set.
    if (!isset($this->data[$name])) {
      // Since we must return by reference, we have to use a constant here. If
      // we return $this->data[$name], an entry will be created in data.
      return $this->NULL_CONST;
    }
    // If it's not an entity, return the regular value.
    try {
      if (is_array($this->data[$name])) {
        // But, if it's an array, check all the values for entity references,
        // and change them.
        array_walk($this->data[$name], [$this, 'referenceToEntity']);
      } elseif (is_object($this->data[$name])
                && !(
                  (
                    is_a($this->data[$name], '\Nymph\Entity')
                    || is_a($this->data[$name], '\SciActive\HookOverride')
                  )
                  && is_callable([$this->data[$name], 'toReference'])
                )) {
        // Only do this for non-entity objects.
        foreach ($this->data[$name] as &$curProperty) {
          $this->referenceToEntity($curProperty, null);
        }
        unset($curProperty);
      }
    } catch (Exceptions\EntityClassNotFoundException $e) {
      throw new Exceptions\EntityCorruptedException($e->getMessage());
    }
    return $this->data[$name];
  }