blob: 303a1440d7ff0998eabe5493adc409434c7169c6 [file] [log] [blame]
<?php
namespace LdapRecord\Models\Relations;
use LdapRecord\Query\Collection;
class HasManyIn extends OneToMany
{
/**
* Get the relationships results.
*
* @return Collection
*/
public function getRelationResults()
{
$results = $this->parent->newCollection();
foreach ((array) $this->parent->getAttribute($this->relationKey) as $value) {
if ($foreign = $this->getForeignModelByValue($value)) {
$results->push($foreign);
}
}
return $this->transformResults($results);
}
}