Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame^] | 1 | <?php |
| 2 | |
| 3 | namespace LdapRecord\Models\ActiveDirectory\Concerns; |
| 4 | |
| 5 | use LdapRecord\Models\ActiveDirectory\Relations\HasOnePrimaryGroup; |
| 6 | |
| 7 | trait HasPrimaryGroup |
| 8 | { |
| 9 | /** |
| 10 | * Returns a new has one primary group relationship. |
| 11 | * |
| 12 | * @param mixed $related |
| 13 | * @param string $relationKey |
| 14 | * @param string $foreignKey |
| 15 | * |
| 16 | * @return HasOnePrimaryGroup |
| 17 | */ |
| 18 | public function hasOnePrimaryGroup($related, $relationKey, $foreignKey = 'primarygroupid') |
| 19 | { |
| 20 | return new HasOnePrimaryGroup($this->newQuery(), $this, $related, $relationKey, $foreignKey); |
| 21 | } |
| 22 | } |