symfony - symfony2 entity customized function: call to undefined function error -


i trying add 3 functions slugifying non-ascii characters in url, slugify function doesn't recognize sanitize() function although in same scope.:|

class blog {     /**     * @orm\onetomany(targetentity="comment", mappedby="blog")     */     protected $comments;     ...     public function slugify($text)     {         return sanitize($text);     }     ...     public function sanitize($title)      {         $title = strip_tags($title);         ...     }     ... } 

i can't load fixtures , exception says "call undefined function ..\sanitize() in ..\entity\blog.php ..."

why happens? tried these: clearing cache, dropping database, recreating database, recreating schemas, recreating entities, reloading fixtures... i've got same error:(

can tell me what's wrong it?

missing $this return statement. when calling sanitize() without $this it's resolving method scope , not class scope.

class blog {     /**     * @orm\onetomany(targetentity="comment", mappedby="blog")     */     protected $comments;     ...     public function slugify($text)     {         return $this->sanitize($text);     }     ...     public function sanitize($title)      {         $title = strip_tags($title);         ...     }     ... } 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -