public function model_call_is_ansestor_of(Jam_Model $model, Jam_Event_Data $data, $descendant) { $descendant_id = $descendant instanceof Jam_Model ? $descendant->id() : $descendant; $data->return = $model->descendants()->where_key($descendant_id)->count_all() > 0; }