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;
        }
    }