Creates the category endpoint (for creating forums)

@param integer $id
@return string
@internal
540663
private function categoryEndpoint($id = null)
    {
        return $id === null ? $this->categoryEndpoint : $this->categoryEndpoint . '/' . $id;
    }
486551
private function createDeleteForm($id) {
        return $this->createFormBuilder()
                        ->setAction($this->generateUrl('admin_news_category_delete', array('id' => $id)))
                        ->setMethod('DELETE')
                        ->add('submit', 'submit', array('label' => 'Delete',
                            'attr' => array(
                                    'onclick' => 'return confirm("Estás seguro?")'
                            )))
                        ->getForm()
        ;
    }
721203
public function getPost($id)
	{
            $post = \App\Blog::find($id);
            if($post == NULL){
                App::abort(404);
            }
            return View('blog::post',array('title'=>$post['title'],'post'=>$post));
	}
1012925
protected function resolveData($id)
    {
        if (!is_null($id)) {
            return $this->getDoctrine()->getRepository($this->getEntityName())
                ->find($id);
        }

        return new Menu();
    }
1020025
public function get_from_post_id(int $id) : ?forum_entity {
        $alias = $this->get_table_alias();
        $thistable = new dml_table(self::TABLE, $alias, $alias);
        $coursemoduletable = new dml_table('course_modules', 'cm', 'cm_');
        $coursetable = new dml_table('course', 'c', 'c_');

        $tablefields = $thistable->get_field_select();
        $coursemodulefields = $coursemoduletable->get_field_select();
        $coursefields = $coursetable->get_field_select();

        $fields = implode(', ', [
            $tablefields,
            context_helper::get_preload_record_columns_sql('ctx'),
            $coursemodulefields,
            $coursefields,
        ]);

        $tables = "{forum_posts} p";
        $tables .= " JOIN {forum_discussions} d ON d.id = p.discussion";
        $tables .= ' JOIN {' . self::TABLE . "} {$alias} ON {$alias}.id = d.forum";
        $tables .= " JOIN {modules} m ON m.name = 'forum'";
        $tables .= " JOIN {course_modules} cm ON cm.module = m.id AND cm.instance = {$alias}.id";
        $tables .= ' JOIN {context} ctx ON ctx.contextlevel = ' . CONTEXT_MODULE .  ' AND ctx.instanceid = cm.id';
        $tables .= " JOIN {course} c ON c.id = {$alias}.course";

        $sql = "SELECT {$fields} FROM {$tables} WHERE p.id = :postid";
        $records = $this->get_db()->get_records_sql($sql, [
            'postid' => $id,
        ]);

        $records = $this->transform_db_records_to_entities($records);
        return count($records) ? array_shift($records) : null;
    }
157957
protected function endpoint($id = null)
    {
        return $id === null ? $this->endpoint : $this->endpoint . '/' . $id;
    }
478665
public function seedCategory($category_id = 0)
    {
        $categories = $this->blender->getCategoryMap();
        if (isset($categories['ids'][$category_id]) && isset($categories['ids'][$category_id]['lineage'])) {
            return $categories['ids'][$category_id]['lineage'];
        }

        return '';
    }
582517
public function show($id)
    {
        $chatbot = $this->client->get(
            sprintf('buckets/%d/chats/%d/integrations/%d.json', $this->bucket, $this->parent, $id)
        );
        $chatbot = new Chatbot($this->response($chatbot));
        $chatbot->inContext($this->bucket, $this->parent);

        return $chatbot;
    }
625978
public function createDirectory(string $id): Directory
    {
        $path = $this->getDirectoryPath($id);
        $this->filesystem->createDir($path);

        return $this->directories[$id] = new static($this->filesystem, $path, $this->format);
    }
388662
public function getPlatformById($id)
    {
        $id = (int) $id;
        $id = max(0, $id);

        return $this->request('platforms/'.$id);
    }
801345
public function createRating($id = null)
    {
        $class = $this->getClass();
        $rating = new $class;

        if (null !== $id) {
            $rating->setId($id);
        }

        $this->dispatcher->dispatch(DCSRatingEvents::RATING_CREATE, new Event\RatingEvent($rating));

        return $rating;
    }
1230305
public function close($id)
	{
		$endpoint = new Close($this->getTransport());
		$endpoint->setId($id);

		try {
			$result = $endpoint->performRequest();
		} catch (ResourceNotFoundException $e) {
			return false;
		}

		return $result['status'] == 204;
	}
39743
public function guidPath ($id)
		{
			$category = $this->get($id);

			if ($category == null)
				return null;
			elseif (empty($category->guidPath))
				$this->buildPaths();

			return $category->guidPath;
		}
616122
public function get(string $id): ?\BearCMS\Internal\Data2\BlogCategory
    {
        $data = Internal\Data::getValue('bearcms/blog/categories/category/' . md5($id) . '.json');
        if ($data !== null) {
            return $this->makeBlogCategoryFromRawData($data);
        }
        return null;
    }
37906
public function actionDeleteCategory($id = null)
    {
        $model = Category::find()->where(['id' => $id])->limit(1)->one();
        if (empty($model)) {
            $this->error(Yii::t('podium/flash', 'Sorry! We can not find Category with this ID.'));
            return $this->redirect(['admin/categories']);
        }
        if ($model->delete()) {
            PodiumCache::clearAfter('categoryDelete');
            Log::info('Category deleted', $model->id, __METHOD__);
            $this->success(Yii::t('podium/flash', 'Category has been deleted.'));
        } else {
            Log::error('Error while deleting category', $model->id, __METHOD__);
            $this->error(Yii::t('podium/flash', 'Sorry! There was some error while deleting the category.'));
        }
        return $this->redirect(['admin/categories']);
    }
372541
public function show($id)
    {
        $question = $this->client->get(
            sprintf('buckets/%d/questions/%d.json', $this->bucket, $id)
        );

        return new Question($this->response($question));
    }
1248556
public function get($id = null)
    {

        // Prep the endpoint
        $endpoint = ($id) ? $this->getEndpoint() . "/" . $id : $this->getEndpoint();

        // Get the resource
        $response = $this->client->get($endpoint, $this->prepareParams());

        // Handle response
        return $this->handleResponse(json_decode($response));

    }