Finds and displays a Post entity.

@Route("/tags-with-weight", name="post_tags_weight")
@Method("GET")
348293
public function getTagsWithWeightAction()
    {

        $em = $this->getDoctrine()->getManager();
        $entities = $em->getRepository('AmulenClassificationBundle:Tag')->getWithWeight();

        $tagArr = array();
        foreach ($entities as $tag) {
            $tagArr[] = array(
                "text" => $tag["name"],
                "weight" => $tag["weight"],
                "link" => $this->generateUrl("page", array("slug" => "news", "tag" => $tag["name"])),
            );
        }

        return new JsonResponse($tagArr, 200);
    }
974597
public function index()
    {
        $entries = WinkTag::when(request()->has('search'), function ($q) {
            $q->where('name', 'LIKE', '%'.request('search').'%');
        })
            ->orderBy('created_at', 'DESC')
            ->withCount('posts')
            ->get();

        return TagsResource::collection($entries);
    }
849813
public function attachTags(int $id, AttachRequest $request)
    {
        /** @var \Unite\Tags\HasTagsInterface $object */
        if(!$object = $this->repository->find($id)) {
            abort(404);
        }

        $data = $request->only(['tag_names']);

        $object->attachTags($data['tag_names']);

        \Cache::tags('response')->flush();

        return $this->successJsonResponse();
    }
256082
private function actionTag() {
        switch ($this->lookahead->getText()) {
            case '@keepDefault':
                $this->actionKeepDefault();
                break;
            case '@queued':
                $this->actionQueued();
                break;
            case '@queue':
                $this->actionQueue();
                break;
        }
    }
1079457
function(req, res, next) {
    Tag.findOne({ name: req.params.name }, function(err, tag) {
      if (err) return next(err);
      if (!tag) return res.json(404, { error: 'failed to load tag ' + req.params.name });
      req.tag = tag;
      next();
    });
  }
879846
public function hasTags()
    {
        $tags = "tags";
        $postType = getPostType($this->getTable());
        return ($postType->hasTags && isset($this->$tags) && !$this->$tags->isEmpty());
    }
1344417
protected function pullPost() {
		if (!is_array($this->postVars)) {
			$this->postVars = $this->request->getParsedBody();
			
			if (!is_array($this->postVars)) {
				$this->postVars = [];
			}
		}
		
		return $this->postVars;
	}
990375
function getPost($key = null, $default = null)
    {
        if (!$this->post)
            $this->setPost($_POST);

        if ($key !== null)
            return $this->post->get($key, $default);

        return $this->post;
    }
1345679
public function indexAction()
    {
        /* @todo: move this into a listener.
         *
         * The following lines allow to override get param[q] with the
         * param from route. This feature is needed for a landing-page feature, where
         * human readable urls like http://yawik.org/demo/de/jobs/sales.html
         *
         * move the Logic into a Listener, which can be activated, if needed
         */
        $request = $this->getRequest();
        $getParams = $request->getQuery();
        $routeParams = $this->params()->fromRoute();
        if (isset($routeParams['q']) && !isset($getParams['q'])) {
            $getParams['q']=$routeParams['q'];
        }

        $result = $this->pagination([
                'params' => ['Jobs_Board', [
                    'q',
                    'count' => $this->options['count'],
                    'page' => 1,
                    'l',
                    'd' => 10]
                ],
                'form' => ['as' => 'filterForm', 'Jobs/JobboardSearch'],
                'paginator' => ['as' => 'jobs', 'Jobs/Board']
            ]);

        $organizationImageCache = $this->imageFileCacheManager;

        $result['organizationImageCache'] = $organizationImageCache;

        return new ViewModel($result);
    }
1150026
public function getSidebarData()
    {
        if ($this->_entityName === 'Veonik\Bundle\BlogBundle\Entity\Category') {
            $join = 'JOIN posts_categories pt ON pt.category_id = t.id ';
        } else {
            $join = 'JOIN posts_tags pt ON pt.tag_id = t.id ';
        }
        
        $stmt = $this->_em->getConnection()->executeQuery(
            "SELECT t.id FROM tags t 
                  {$join}
                  JOIN posts p ON pt.post_id = p.id 
                WHERE p.active = TRUE 
                  AND t.active = TRUE
                GROUP BY t.id
                ORDER BY COUNT(p.id) DESC
                LIMIT 10"
        );
        $results = $stmt->fetchAll(\PDO::FETCH_COLUMN);
        
        return $this->createQueryBuilder('t')
            ->join('VeonikBlogBundle:AbstractPost', 'p')
            ->where('t.id IN (:ids)')
            ->setParameter('ids', $results)
            ->getQuery()
            ->useResultCache(true, 3600, 'sidebar_tags' . $this->_entityName)
            ->getResult();
    }
374092
public function postMergeAction(Request $request)
    {
        try {
            $srcTagIds = explode(',', $request->get('src'));
            $destTagId = $request->get('dest');

            $destTag = $this->getManager()->merge($srcTagIds, $destTagId);

            $view = $this->view(
                null,
                303,
                [
                    'location' => $this->get('router')->generate('get_tag', ['id' => $destTag->getId()]),
                ]
            );
        } catch (TagNotFoundException $exc) {
            $entityNotFoundException = new EntityNotFoundException(self::$entityName, $exc->getId());
            $view = $this->view($entityNotFoundException->toArray(), 404);
        }

        return $this->handleView($view);
    }
261867
@PostMapping(
      value = "/{entityTypeId}/meta/{attributeName}",
      params = "_method=GET",
      produces = APPLICATION_JSON_VALUE)
  public AttributeResponse retrieveEntityAttributeMetaPost(
      @PathVariable("entityTypeId") String entityTypeId,
      @PathVariable("attributeName") String attributeName,
      @Valid @RequestBody EntityTypeRequest request) {
    Set<String> attributeSet = toAttributeSet(request != null ? request.getAttributes() : null);
    Map<String, Set<String>> attributeExpandSet =
        toExpandMap(request != null ? request.getExpand() : null);

    return getAttributePostInternal(entityTypeId, attributeName, attributeSet, attributeExpandSet);
  }
216642
protected function getPostedData()
    {
        $resourcePostedDataMode = $this->getResource()->getPostedDataMethod();
        $endpointPostedDataMode = $this->getEndpoint()->getPostedDataMethod();

        $postedDataMode = $resourcePostedDataMode;
        if ($endpointPostedDataMode != PostedDataMethods::AUTO) {
            $postedDataMode = $endpointPostedDataMode;
        }

        $postedData = null;

        switch ($postedDataMode) {

            case PostedDataMethods::POST:
                $postedData = $this->request->getPost();
                break;

            case PostedDataMethods::JSON_BODY:
                $postedData = $this->request->getJsonRawBody(true);
                break;

            case PostedDataMethods::AUTO:
            default:
                $postedData = $this->request->getPostedData($this->getEndpoint()->getHttpMethod());
        }

        return $postedData;
    }
1365395
public function getTags($postUuid)
    {
        $event = new GenericDataEvent([
            'class' => 'Icap\BlogBundle\Entity\Post',
            'ids' => [$postUuid],
        ]);

        $this->eventDispatcher->dispatch(
            'claroline_retrieve_used_tags_by_class_and_ids',
            $event
        );
        $tags = $event->getResponse();

        return $tags;
    }
811286
public function publishedPostsAction()
    {
        $this->routeParam()->mapPageTo($this->queryService);

        if ($tag = $this->params()->fromRoute('tag')) {
            $collection = $this->queryService->findPublishedPostsByTag($tag);
        } else {
            $collection = $this->queryService->findPublishedPosts();
        }

        return $this->viewModelFactory()->createFor($collection);
    }
657744
public function index(Request $request)
    {
        $query = Tag::query();

        if ($request->has('filter.containing')) {
            $query->containing($request['filter']['containing']);
        }

        if ($request->has('filter.type')) {
            $query->where('type', $request['filter']['type']);
        }

        if ($request->has('limit')) {
            $query->limit($request['limit']);
        }

        return $query->get()->map(function (Tag $tag) {
            return $tag->name;
        });
    }
1368921
public function addTags(): void
    {
        $tags = $this->getTags();
        $currentStructureUuid = $this->getCurrentStructureUuid();
        if ($currentStructureUuid && !in_array($currentStructureUuid, $tags)) {
            $tags[] = $currentStructureUuid;
        }

        if (count($tags) <= 0) {
            return;
        }

        $this->symfonyResponseTagger->addTags($tags);
    }