Add posts

@param \Mvc\BlogBundle\Entity\Post $posts
@return Category
436469
public function addPost(\Mvc\BlogBundle\Entity\Post $posts)
    {
        $this->posts[] = $posts;

        return $this;
    }
735959
public function addPost(ForumThreadPost $post)
    {
        if ($this->posts->contains($post) === false) {
            $post->setThread($this);
            $this->posts->add($post);
        }

        return $this;
    }
761505
protected function submitAddCategoryGroup()
    {
        $this->setSubmitted(null, $this->getParam());
        $this->validateComponent('category_group');
        $this->addCategoryGroup();
    }
106301
public function add($comment)
    {
        if (is_array($comment)) {
            $this->collection[] = new Comment($comment);
        } elseif (is_object($comment) && $comment instanceof Comment) {
            $this->collection[] = $comment;
        }

        return $this;
    }
247922
public function setCategory(\Mvc\BlogBundle\Entity\Category $category)
    {
        $this->category = $category;

        return $this;
    }
650599
public function addSubCategory(CategoryInterface $category)
    {
        if (!$this
            ->subCategories
            ->contains($category)
        ) {
            $this
                ->subCategories
                ->add($category);
        }

        return $this;
    }
222610
public function edit(Post $post)
    {
        $this->authorize(PostsPolicy::PERMISSION_UPDATE);

        $this->setTitle($title = trans('blog::posts.titles.edit-post'));
        $this->addBreadcrumb($title);

        $categories = Category::getSelectData();
        $tags       = Tag::getSelectData();
        $statuses   = Post::getStatuses();

        return $this->view('admin.posts.edit', compact('post', 'categories', 'tags', 'statuses'));
    }
918328
public function newAction()
    {
        $entity = new Post();
        $form   = $this->createForm(new PostType(), $entity);

        return array(
            'entity' => $entity,
            'form'   => $form->createView(),
        );
    }
250936
public function posts($posttype = null, $arguments = [])
    {
        return $this->model->postsWith($this, $posttype, $arguments);
    }
95025
public static function updateMenulink($post)
    {
        if(self::isInMenuLinks($post->postID, $post->getTable())) {
            $menuLinks = MenuLink::where('belongsToID', $post->postID)->where('belongsTo', $post->getTable())->get();
            foreach($menuLinks as $menuLink){
                $menuLink->params = $post->menuLinkParameters();
                $menuLink->save();
            }
        }
    }
440308
public function addCategorie(\Haven\CoreBundle\Entity\Category $categories)
    {
        $this->categories[] = $categories;
    
        return $this;
    }
658853
public function addParentCategory(CategoryInterface $category): CategoryInterface
    {
        if (!$this->hasParentCategory($category)) {
            $this->parentCategories->add($category);
        }

        return $this;
    }
239433
private function add_relationships($post_type)
    {
        if (! empty($this->taxonomies)) {
            $filters = [];

            foreach ($this->taxonomies as $k => $v) {
                // Add all taxonomies to $filters unless explicitly declared otherwise.
                if (\is_integer($k)) {
                    $post_type->taxonomy($v);
                    $filters[] = $v;
                    continue;
                }

                if ($v === false) {
                    $post_type->taxonomy($k);
                }
            }

            $post_type->filters($filters);
        }
    }
694052
public function post(array $categories) {
    $storeId = '';
    $requestHeaders = $this->currentRequest->headers;
    if ($requestHeaders->has('X-ACM-UUID')) {
      $storeId = $requestHeaders->get('X-ACM-UUID');
    }

    if (!$this->categoryVid) {
      return (new ModifiedResourceResponse(['success' => FALSE]));
    }

    $response = $this->categoryManager->synchronizeCategory(
      $this->categoryVid,
      $categories,
      $storeId
    );

    $response['success'] = (bool) (($response['created'] > 0) || ($response['updated'] > 0));

    return (new ModifiedResourceResponse($response));
  }
971149
public static function hasPosts($postType, $categoriesID)
    {
        if(DB::table(categoriesRelationTable($postType))->where('categoryID', $categoriesID)->count()
        ) {
            return true;
        }else{
            return false;
        }
    }
1281786
private function createPostTypes()
    {
        if(!$this->option('posts') && ($this->option('post_types') || $this->option('all'))) {
            $this->comment('Creating dummy Post Types...');
            $output = (new \PostTypeSeeder())
                ->setCommand($this)
                ->run($this->getDefaultOption('post_types'));
            $this->info($output);
        }
        return $this;
    }
1188117
public static function add(/** polymorphic **/)
    {
       $args = func_get_args();
       $that = self::get_this($args);
       $term = self::get_term($args);

       $url = URIResource::Make($that->path, array($that->id, $term));

       $id = Locator::Find($that->client->post($url, $args->get()));
        
       return $this->$term($id);
    }