This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
vbbs/app/Models/CUG.php
2018-12-10 23:33:38 +11:00

21 lines
305 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class CUG extends Model
{
protected $table = 'cugs';
public function isMember(CUG $o)
{
while ($o)
{
if (! $this->parent_id OR $o->id == $this->parent_id)
return TRUE;
$o = $this::findOrFail($o->parent_id);
}
}
}