blob: 6c97cf9257e3b2c16e134fd4c067d4ac11aee225 [file] [log] [blame]
<?php
namespace LdapRecord\Models\Concerns;
trait HasScopes
{
/**
* Begin querying the direct descendants of the model.
*
* @return \LdapRecord\Query\Model\Builder
*/
public function descendants()
{
return $this->in($this->getDn())->listing();
}
/**
* Begin querying the direct ancestors of the model.
*
* @return \LdapRecord\Query\Model\Builder
*/
public function ancestors()
{
$parent = $this->getParentDn($this->getDn());
return $this->in($this->getParentDn($parent))->listing();
}
/**
* Begin querying the direct siblings of the model.
*
* @return \LdapRecord\Query\Model\Builder
*/
public function siblings()
{
return $this->in($this->getParentDn($this->getDn()))->listing();
}
}