Get Category by id
@param  integer $id Id for category
@return bool|array     Array of the name and description or false
975230
function getCategory($id)
    {
        $result = $this->db->query('SELECT * FROM category WHERE id = :id', [':id'=>(0+$id)]);
        if (isset($result[0])) {
            return ['name'=>$result[0]->get('name'),
                'description'=>$result[0]->get('description')];
        }
        return false;
    }
136872
public function fetchById($id)
    {
        $data = $this->getRequest()->getContents($this->getKey(), $id);
        return $data;
    }
597230
private function deleteCategory(int $id)
    {
        $category = Category::find($id);
        if($category) {
            $postType = PostType::findByID($category->postTypeID);
            if(Category::isInMenuLinks($id)) {
                return $this->response("You can't delete this Category. It is part of a menu", 403);
            }

            // delete children
            $category->deleteChildren($category->categoryID, $postType->postTypeID);

            // delete relations
            DB::table(categoriesRelationTable($postType->slug))->where("categoryID", $category->categoryID)->delete();

            // Delete the item
            if($category->delete()) {
                return true;
            }
        }
        return false;
    }
1063719
public function findById($id)
    {
        $result = array();
        $relations = $this->getRelations();

        $items = $relations[RelationBuilder::TREE_PARAM_ITEMS];

        if (isset($items[$id])) {
            return $items[$id];
        } else {
            return false;
        }
    }
1115959
public function show($id)
    {
        $messageType = $this->client->get(
            sprintf('buckets/%d/categories/%d.json', $this->bucket, $id)
        );

        return new MessageType($this->response($messageType));
    }
571923
public function getQuestion4Id($id)
    {
        $query = $this->createQueryBuilder('p')
            ->select('p')
            ->where('p.id = :id')
            ->setParameter('id', $id)
            ->getQuery();


        return $query->getOneOrNullResult();
    }
161425
public function getTaxonomiesWithArcRoleTypeId( $id )
	{
		return array_filter( $this->importedSchemas, function( /** @var XBRL $taxonomy */ $taxonomy ) use( $id )
		{
			return $taxonomy->hasArcRoleTypeId( $id ); }
		);
	}
823991
public function get($id)
	{
		$success = FALSE;
		$data = apc_fetch($id, $success);

		if ($success === TRUE)
		{
			return is_array($data)
				? unserialize($data[0])
				: $data;
		}

		return FALSE;
	}
988049
public function titlePath ($id)
		{
			$category = $this->get($id);

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

			return $category->titlePath;
		}
1276395
public function get($id)
    {
        if (!$this->has($id)) {
            return;
        }

        return $this->container->findDefinition($id)->getClass();
    }
1086986
public function findAssociationCategoryByID($id)
    {
        $categories = $this->findAssociationCategories()->getCategories();

        $categories->rewind();

        while ($categories->valid()) {
            $category = $categories->current();
            if ($category->getID() == $id) {
                return $category;
            }

            $categories->next();
        }
    }
257263
private function get_category( $post_id ) {
		$category_data = get_the_category( $post_id );
		$category_arr  = [];
		foreach ( $category_data as $cat ) {
			array_push( $category_arr, $cat->term_id );
		}

		return $category_arr;
	}
1139330
public function getById($id)
    {
        if (!isset($this->pluginInstances[$id])) {
            $class = $this->getPluginClass($id);
            if (!class_exists($class)) {
                $this->pluginInstances[$id] = false;
            } else {
                $this->pluginInstances[$id] = new $class(['wei' => $this->wei]);
            }
        }

        return $this->pluginInstances[$id];
    }
1124850
public function getById($id)
    {
        $list = $this->getByCriteria($id, $this->getUniqueId());
        return reset($list);
    }
125041
public function get($categoryId, $params = array())
    {
        $resource = 'category/' . $categoryId . '.json';
        $resource .= '?' . $this->buildQueryString($params);
        $response = $this->getServiceResponse($resource);

        $getCategoryResponse = new Models\ResponseCategoryGet($response);

        return $getCategoryResponse->getCategory();
    }
1174378
public function actionDelete($id)
    {
        $this->trigger(self::EVENT_BEFORE_DELETE_CATEGORY);

        $category = Category::findOne($id);
        if (($category->delete())) {
            Yii::$app->getSession()->setFlash('success', 'The category has been successfully removed');
            if (\Yii::$app->request->isAjax) {
                return true;
            }
            $this->trigger(self::EVENT_AFTER_DELETE_CATEGORY, new CategoryEvent(['id' => $id]));
        } else {
            Yii::$app->getSession()->setFlash('error', 'Error deleting category');
        }

        if (\Yii::$app->request->isAjax) {
            return false;
        }
        return $this->redirect(\Yii::$app->request->referrer);
    }
94292
public function get_definition_by_id($id) {
        if (array_key_exists($id, $this->configdefinitions)) {
            return $this->configdefinitions[$id];
        }
        return false;
    }