Example #1
0
 protected function addPostCategories(PostInterface $post)
 {
     foreach ($post->getCategories() as $cat) {
         if (!$cat instanceof CategoryInterface) {
             continue;
         }
         $data = Category::toArray($cat);
         $cat = $this->createCategory($data);
         $this->addCategory($cat);
     }
 }