Bundle/BlogBundle/Entity/Blog.php
public function setCategories($categories)
    {
        foreach ($categories as $category) {
            $category->setBlog($this);
        }
        $this->categories = $categories;

        return $this;
    }
public function setCategories($categories)
    {
        foreach ($categories as $category) {
            $category->setBlog($this);
        }
        $this->categories = $categories;

        return $this;
    }
public function setCategories ( $ categories ) { foreach ( $ categories as $ category ) { $ category -> setBlog ( $ this ) ; } $ this -> categories = $ categories ; return $ this ; }
Set categories.

@param string $categories

@return Blog
Set categories .