public function methodExists($method)
    {
        $key = 'method.'.$method;

        if (!self::_cache($this)->offsetExists($key)) {
            $result = false;

            if (method_exists($this, $method)) {
                $result = true;
            } elseif (self::_cache($this)->offsetExists('behavior.'.$method)) {
                $result = self::_cache($this)->offsetGet('behavior.'.$method);
            } else {
                $behaviors = $this->getRepository()->getBehaviors();

                foreach ($behaviors as $behavior) {
                    if (in_array($method, $behavior->getMixableMethods($this))) {
                        $result = true;
                        break;
                    }
                }
            }

            self::_cache($this)->offsetSet($key, $result);
        }

        return self::_cache($this)->offsetGet($key);
    }
public function methodExists($method)
    {
        $key = 'method.'.$method;

        if (!self::_cache($this)->offsetExists($key)) {
            $result = false;

            if (method_exists($this, $method)) {
                $result = true;
            } elseif (self::_cache($this)->offsetExists('behavior.'.$method)) {
                $result = self::_cache($this)->offsetGet('behavior.'.$method);
            } else {
                $behaviors = $this->getRepository()->getBehaviors();

                foreach ($behaviors as $behavior) {
                    if (in_array($method, $behavior->getMixableMethods($this))) {
                        $result = true;
                        break;
                    }
                }
            }

            self::_cache($this)->offsetSet($key, $result);
        }

        return self::_cache($this)->offsetGet($key);
    }
public function methodExists ( $ method ) { $ key = 'method.' . $ method ; if ( ! self :: _cache ( $ this ) -> offsetExists ( $ key ) ) { $ result = false ; if ( method_exists ( $ this , $ method ) ) { $ result = true ; } elseif ( self :: _cache ( $ this ) -> offsetExists ( 'behavior.' . $ method ) ) { $ result = self :: _cache ( $ this ) -> offsetGet ( 'behavior.' . $ method ) ; } else { $ behaviors = $ this -> getRepository ( ) -> getBehaviors ( ) ; foreach ( $ behaviors as $ behavior ) { if ( in_array ( $ method , $ behavior -> getMixableMethods ( $ this ) ) ) { $ result = true ; break ; } } } self :: _cache ( $ this ) -> offsetSet ( $ key , $ result ) ; } return self :: _cache ( $ this ) -> offsetGet ( $ key ) ; }
Check if method exists between the entities and all its behavior. It caches
the result once for the whole repository in order to improve performance.

@return bool
Check if method exists between the entities and all its behavior . It caches the result once for the whole repository in order to improve performance .