Return latest messages of an hashtag
@param string $id
@return Object[]
- id
- author
- dateCreated
- message
- longMessage
- mediaURL
@throws Exception
339829
public function getHashtagMessages($name, $offset = 0, $length = 10)
	{
		if(!$name)
		{
			throw new Exception('Please specify a tag name');
		}
		return $this->execute('GET', '/maniaflash/hashtags/%s/messages/?offset=%d&length=%d', array($name, $offset, $length));
	}
619098
public function getShowInfo($id)
    {
        $showInfo = array();

        $crawler = $this->request('GET', $this->baseUrl . '/title/' . $id . '/');
        $showInfo['title'] = $crawler->filterXPath('//h1/span[@itemprop="name"]')->text();

        $nextEpisode = $crawler->filterXPath('//div[@class="next-episode"]/div');
        if (count($nextEpisode) && preg_match('/S(?P<season>[0-9]+), Ep(?P<episode>[0-9]+)/', $nextEpisode->text(), $match)) {
            $showInfo['latestSeason'] = $match['season'];
            $showInfo['latestEpisode'] = $match['episode'];
        } else {
            $showInfo['latestSeason'] = $crawler->filterXPath('//div[@id="titleTVSeries"]//h4[text()="Season:"]/../span[1]/a[1]')->text();
            $today = time(0, 0, 0);
            do {
                $seasonEpisodes = $this->getSeasonEpisodes($id, $showInfo['latestSeason']);
                $currentEpisodes = array_filter($seasonEpisodes, function($episode) use ($today) {
                    return strtotime($episode['airdate']) < $today;
                });
                if ($currentEpisodes) {
                    $showInfo['latestEpisode'] = max(array_keys($currentEpisodes));
                    break;
                } elseif ($showInfo['latestSeason'] > 1) {
                    $showInfo['latestSeason']--;
                } else {
                    $showInfo['latestEpisode'] = 1;
                }
            } while ($showInfo['latestSeason'] >= 1);
        }

        return $showInfo;
    }
1193466
public function getRecurrenceEventId(?string $id = null): array
    {
        $result = [];

        if (empty($id)) {
            return $result;
        }

        if (preg_match('/(^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12})(__(\d+)?_(\d+)?)?/', $id, $matches)) {
            $result['id'] = $matches[1];
            $result['start'] = !empty($matches[3]) ? date('Y-m-d H:i:s', $matches[3]) : null;
            $result['end'] = !empty($matches[4]) ? date('Y-m-d H:i:s', $matches[4]) : null;
        }

        return $result;
    }
716453
public function getReport($id = null)
    {
        if ($id === null) {
            $id = $this->id;
        }

        return array('runId' => $id, 'report' => sprintf('%s?run=%s&source=%s', $this->host, $id, $this->namespace));
    }
320765
public function archive($id)
    {
        $id = (int) $id;
        if ($id <= 0) {
            throw new Exception('Invalid param id');
        }
        $data = [];
        $data['id'] = $id;
        $data['status'] = 'archived';
        return $this->update($data);
    }
794756
public function getById($id) : Response
    {
        //find the info
        $user = $this->model->findFirst([
            'id = ?0 AND is_deleted = 0',
            'bind' => [$this->userData->getId()],
        ]);

        $user->password = null;

        //get relationship
        if ($this->request->hasQuery('relationships')) {
            $relationships = $this->request->getQuery('relationships', 'string');

            $user = QueryParser::parseRelationShips($relationships, $user);
        }

        if ($user) {
            return $this->response($user);
        } else {
            throw new Exception('Record not found');
        }
    }
427676
public function readMessages($id)
    {
        if ($this->isEmptyId($id)) {
            throw new InvalidArgumentException;
        }

        $res = $this->call('conversations/' . $id . '/markread', [], 'post');

        if ($res) {
            return true;
        }

        return false;
    }
327653
public function getTagById( $id, $throwException = TRUE )
	{
		$xpath	= new DomXPath( $this->document );
		$query	= "//*[@id = '$id']";
		$tags	= $this->getTagsByXPath( $query );
		if( $tags )
			return $tags[0];
		if( $throwException )
			throw new RuntimeException( 'No Tag with ID "'.$id.'" found.' );
		return NULL;
	}
1288946
public function actionUpdate($id)
    {
        $model = $this->findModel($id);
        $oldSubmodulesParentUid = $model->parent_uid . '/{' . $model->id . '}';

        $post = Yii::$app->request->post();
        $loaded = $model->load($post);
        if ($loaded && $model->save()) {
            $newSubmodulesParentUid = $model->parent_uid . '/{' . $model->id . '}';
            $model->correctParents($oldSubmodulesParentUid, $newSubmodulesParentUid);

            //return $this->redirect(['view', 'id' => $model->id]);
            return $this->redirect(['index', 'id' => $model->id]);
        } else {
            return $this->render('update', [
                'model' => $model,
            ]);
        }
    }
93904
protected function getSnapshot($id)
    {
        $snapshot = $this->snapshotManager->findOneBy(['id' => $id]);

        if (null === $snapshot) {
            throw new NotFoundHttpException(sprintf('Snapshot (%d) not found', $id));
        }

        return $snapshot;
    }
418962
public function getMessage($id)
    {
        $bodyLines = 0;
        $header = $this->_protocol->top($id, $bodyLines, true);
        $message = $message = $this->getRawContent($id);
        return new Message($header, $message, $id);
    }
608254
public function AnimeNews(int $id): array
    {
        return $this->myanimelist->getNewsList(
            new Request\Anime\AnimeNewsRequest($id)
        );
    }
650078
function fetchMessage(string $id) {
        return (new \React\Promise\Promise(function (callable $resolve, callable $reject) use ($id) {
            $this->client->apimanager()->endpoints->channel->getChannelMessage($this->id, $id)->done(function ($data) use ($resolve) {
                $message = $this->_createMessage($data);
                $resolve($message);
            }, $reject);
        }));
    }
1304934
public function getModelVersions($id)
    {
        $modelResult = $this->getRequest()->request(
            'GET',
            $this->getRequestUrl(sprintf('models/%s/versions', $id))
        );

        if (!isset($modelResult['model_versions'])) {
            throw new \Exception('Model Versions Not Found');
        }

        $modelVersions = [];

        foreach ($modelResult['model_versions'] as $version) {
            $modelVersion = new ModelVersion($version);
            $modelVersions[] = $modelVersion;
        }

        return $modelVersions;
    }
1136553
public function get($id)
    {
        if (empty($id)) {
            throw new \Exception('cannot load object with empty id');
        }

        $params = new RequestParams(RequestOps::GET, $this->resourceMetadata, $id);
        $jsonResponse = $this->request($params);

        if ($jsonResponse == false) {
            throw new Exception('Error retrieving data');
        }

        $inst = $this->createResourceInst($jsonResponse, $this->resourceMetadata->resourceClass);

        $this->postProcess($inst);

        return $inst;
    }
227166
public function getMessages($id, $limit = 20, $offset = 0)
    {
        if ($this->isEmptyId($id)) {
            throw new InvalidArgumentException;
        }

        $params = [
            'count' => $limit,
            'after' => $offset
        ];

        $data = $this->call('conversations/' . $id . '/parts', $params, 'get');

        $array = [];
        if ($data) {
            foreach ($data as $msg) {
                $array[] = Message::fromResponse($msg);
            }
        }

        return $array;
    }
298107
public function find($id)
    {
        if (empty($id)) {
            throw new \Exception('ID must be set');
        }

        $response = $this->restClient->get($this->endpoint . '/' . $id);

        return $response['body'];
    }