Find Posting for id

@author Tom Haskins-Vaughan <tom@tomhv.uk>
@since  0.8.0

@param  int $id

@return Posting
978676
public function findPostingForId($id)
    {
        $dql = '
            SELECT    p
            FROM      %s p
            WHERE     p.id = :id
            AND       p.organization = :organization
        ';

        return $this->em
            ->createQuery(sprintf($dql, $this->postingFqcn))
            ->setParameter('id', $id)
            ->setParameter('organization', $this->oh->getOrganization())
            ->getSingleResult()
        ;
    }
336076
public function actionIndexPost($id=NULL)
	{
		if ($id === NULL)
		{
			$category = new Categories;
			$category->parent_id = 1;
		}
		else
		{
			$category = Categories::model()->findByPk($id);
			if ($category == NULL)
				throw new CHttpException(404, Yii::t('Api.category', 'A category with the id of {{id}} was not found.', array('{{id}}' => $id)));
		}

		$category->attributes = $_POST;

		if ($category->save())
			return $category->getAPIAttributes(array('parent_id'), array('parent', 'metadata'));

		return $this->returnError(400, NULL, $category->getErrors());
	}
397837
private function findNode($id)
    {
        $node = $this->get('clastic.node_manager')
            ->loadNode($id);

        if (!$node) {
            throw new NotFoundHttpException();
        }

        return $node;
    }
1219724
public function findOrFail(int $id)
    {
        $response = $this->model->with($this->with)->findOrFail($id);
        $this->with = [];
        return $response;
    }
706838
public static function find_by_id($id)
	{
		$row = self::oneOrNew($id);

		if (!$row->get('id'))
		{
			return false;
		}

		return $row;
	}
791594
public function find($id)
    {
        $key = $this->getHash().$id;
        if($this->getFileManager()->has($key)) {
            return $this->loadEntity($key);
        }
        
        return null;
    }
245251
public function findCacheById(int $id)
    {

        // Check if already in addToCache
        if ($this->isCachedById($id)) {
            return $this->cacheById[$id];
        }

        return null;
    }
84165
public function actionLast($id = null)
    {
        if (!is_numeric($id) || $id < 1) {
            $this->error(Yii::t('podium/flash', 'Sorry! We can not find the thread you are looking for.'));
            return $this->redirect(['forum/index']);
        }

        $thread = Thread::find()->where(['id' => $id])->limit(1)->one();
        if (empty($thread)) {
            $this->error(Yii::t('podium/flash', 'Sorry! We can not find the thread you are looking for.'));
            return $this->redirect(['forum/index']);
        }

        $url = [
            'forum/thread',
            'cid' => $thread->category_id,
            'fid' => $thread->forum_id,
            'id' => $thread->id,
            'slug' => $thread->slug
        ];

        $count = $thread->postsCount;
        $page = floor($count / 10) + 1;
        if ($page > 1) {
            $url['page'] = $page;
        }
        return $this->redirect($url);
    }
464429
public function findById($id)
    {
        try
        {
            return $this->sentry->findUserById($id);
        }
        catch (SentryUserNotFoundException $e)
        {
            throw new UserNotFoundException($e->getMessage());
        }
    }
604313
public function getPostEditPost($id)
    {
        $form = new EditPostForm($this->di, $id);
        $form->check();

        $views = [
            ["comment/default-form", ["form" => $form->getHTML()], "main"]
        ];

        $this->di->get("pageRenderComment")->renderPage([
            "views" => $views,
            "title" => "Edit post | $id"
        ]);
    }
779676
public function findById($id)
    {
        $id = (int) $id;
        if ($id) {
            $sql = sprintf("SELECT id, name, created_at FROM {$this->tableName} WHERE id=%d LIMIT 1", $id);
            if ($row = $this->adapter->selectRow($sql)) {
                return $this->_makeModel($row);
            }
        }
        return null;
    }
437970
public function findById($id)
    {
        foreach ($this->items as $page) {
            if ($page->getId() == $id) {
                return $page;
            } else if ($found = $page->getPages()->findById($id)) {
                return $found;
            }
        }
    }
916909
public function findById($id)
    {
        $query =
            'SELECT `' .
            $this->getFields("`, `") . '`
            FROM ' . $this->tableName .
            ' WHERE `id`=:id LIMIT 1';
        $statement = $this->database->prepare($query);
        $statement->bindParam(':id', $id);
        $statement->execute();
        $this->entity->fill($statement->fetch());
        return $this->entity;
    }
1292318
public static function find($id, array $params = [])
    {
        $instance = new static([], static::getParentID());

        return $instance->request($instance->getEndpoint(), 'find', [$id, $params]);
    }
1008407
public function findDocument($id)
    {
        $documentPath = '/'.$this->databaseName.'/'.urlencode($id);

        return $this->httpClient->request('GET', $documentPath);
    }
812442
protected function findOrFail($id)
    {
        $model = $this->model;
        if ($this->withTrashed()) {
            return $model::withTrashed()->findOrFail($id);
        } else {
            return $model::findOrFail($id);
        }
    }
714080
public function find($id)
    {
        return $this
            ->getQueryBuilder()
            ->andWhere($this->getAlias().'.id = '.intval($id))
            ->getQuery()
            ->getOneOrNullResult()
        ;
    }