Hi,
I have a method in a model class that checks if a certain user has access to a certain item.
public function hasAccess($id, $user_id)
{
$this->load(array('id=? AND user_id
=?',$id, $user_id
));
if(! $this->dry())
{
return true;
}
return false;
}
I want to make this method static so I can use it without instantiating the class, using the double colon operator with the impossible name.
This returns an error: Using $this when not in object context
I understand why this is thrown, but I do not know how to solve this while using the ORM functionality of the DB\SQL\Mapper class.
Is there an easy way to get around this or would it make more sense to just instantiate the class first and use the method non-statically?