/** * Checks if the object or one of it's mixins inherits from a class. * * @param string|object The class to check * @return boolean Returns TRUE if the object inherits from the class */ public function inherits($class) { if ($this instanceof $class) { return true; } if (!parent::inherits($class)) { //check the mixins registered with the entity mapper $behaviors = $this->getRepository()->getBehaviors(); foreach ($behaviors as $behavior) { if ($behavior instanceof $class) { return true; } } return false; } else { return true; } }