get a list of messages with number and size

@param int $id number of message
@return int|array size of given message of list with all messages as array(num => size)
@throws Zend_Mail_Protocol_Exception
12321
public function getSize($id = 0)
    {
        $id = $id ? $id : null;
        return $this->_protocol->getList($id);
    }
414935
public function getVideoList($id)
    {

        $this->setId($id);

        $list = array();
        $data = $this->getData($this->baseChannelUrl);

        if(!$data) {
            throw new \Exception("Video channel not found");
        }

        foreach ($data as $value) {
            $list[$value->id] = array(
                'id'              => $value->id,
                'title'           => $value->title,
                'description'     => $value->description,
                'thumbnail_small' => $value->thumbnail_small,
                'thumbnail_large' => $value->thumbnail_large,
                'duration'        => $value->duration,
                'upload_date'     => $value->upload_date,
                'like_count'      => isset($value->stats_number_of_likes) ? $value->stats_number_of_likes : 0,
                'view_count'      => isset($value->stats_number_of_plays) ? $value->stats_number_of_plays : 0,
                'comment_count'   => isset($value->stats_number_of_comments) ? $value->stats_number_of_comments : 0
            );
        }
        return $list;
    }
1074219
public function getList($id = 0)
	{
		// Build the request path.
		$uri = new Uri($this->fetchUrl('/repositories'));

		if ($id)
		{
			$uri->setVar('since', (int) $id);
		}

		// Send the request.
		return $this->processResponse($this->client->get($uri));
	}
85440
public function lists($id = 0)
    {
        $response = $this->http->get(self::API_GET.'?id='.$id);

        return $response['department'];
    }
53516
public function getSize($id = 0)
    {
        if ($id) {
            return $this->_protocol->fetch('RFC822.SIZE', $id);
        }
        return $this->_protocol->fetch('RFC822.SIZE', 1, INF);
    }
1361705
public function setMessageId($id = true)
    {
        if ($id === null || $id === false) {
            return $this;
        } elseif ($id === true) {
            $id = $this->createMessageId();
        }

        if ($this->_messageId === null) {
            $id = $this->_filterOther($id);
            $this->_messageId = $id;
            $this->_storeHeader('Message-Id', '<' . $this->_messageId . '>');
        } else {
            /**
             * @see Zend_Mail_Exception
             */
            // require_once 'Zend/Mail/Exception.php';
            throw new Zend_Mail_Exception('Message-ID set twice');
        }

        return $this;
    }
490184
public function prepEmailData($id) {

        $email = $this->email_message->find($id);

        // Build the email data
        // $data is an array
        $data = [];
        $data['from_name']            = $email->from_name;
        $data['from_email_address']   = $email->from_email_address;
        $data['to_name']              = $email->to_name;
        $data['to_email_address']     = $email->to_email_address;
        $data['subject']              = $email->subject;
        $data['body']                 = $email->body;
        $data['site_name']            = config('lasallecmsfrontend.site_name');
        $data['sender_email_address'] = "info@southlasalle.com";

        return $data;
    }
928696
private function checkMessageId($id)
    {
        if(!is_int($id)){
            throw new ImapClientException('$id must be an integer!');
        };
        if($id <= 0){
            throw new ImapClientException('$id must be greater then 0!');
        };
        if($id > $this->countMessages()){
            throw new ImapClientException('$id does not exist');
        }
    }
42003
public function getMessages($number = 0, $start = 0, $order = 'DESC') {
        if ($number == 0)
        {
            $number = $this->countMessages();
        }
        $emails = array();
        $result = imap_search($this->imap, 'ALL');
        if ($result)
        {
            $ids = array();
            foreach ($result as $k => $i)
            {
                $ids[] = $i;
            }

            if ($order == 'DESC')
            {
                $ids = array_reverse($ids);
            }
            $ids = array_chunk($ids, $number);
            $ids = $ids[$start];

            foreach ($ids as $id)
            {
                $emails[] = $this->getMessage($id);
            }
        }
        return $emails;
    }
1083660
public function actionViewSent($id = null)
    {
        $model = Message::find()->where([
                'and',
                ['id' => $id, 'sender_id' => User::loggedId()],
                ['!=', 'sender_status', Message::STATUS_DELETED]
            ])->limit(1)->one();
        if (empty($model)) {
            $this->error(Yii::t('podium/flash', 'Sorry! We can not find the message with the given ID.'));
            return $this->redirect(['messages/inbox']);
        }
        $model->markRead();
        return $this->render('view', [
            'model' => $model,
            'type' => 'sent',
            'id' => $model->id
        ]);
    }
1219724
public function findOrFail(int $id)
    {
        $response = $this->model->with($this->with)->findOrFail($id);
        $this->with = [];
        return $response;
    }
1146772
public function viewThread(int $id): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/notifications/threads/:id', (string)$id));
    }
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;
    }
571923
public function getQuestion4Id($id)
    {
        $query = $this->createQueryBuilder('p')
            ->select('p')
            ->where('p.id = :id')
            ->setParameter('id', $id)
            ->getQuery();


        return $query->getOneOrNullResult();
    }
184534
public function AnimeForum(int $id): array
    {
        return $this->myanimelist->getAnimeForum(
            new Request\Anime\AnimeForumRequest($id)
        );
    }
742370
public function actionReply($id = null)
    {
        $podiumUser = User::findMe();

        if (Message::tooMany($podiumUser->id)) {
            $this->warning(Yii::t('podium/flash', 'You have reached maximum {max_messages, plural, =1{ message} other{ messages}} per {max_minutes, plural, =1{ minute} other{ minutes}} limit. Wait few minutes before sending a new message.', [
                'max_messages' => Message::SPAM_MESSAGES,
                'max_minutes' => Message::SPAM_WAIT
            ]));
            return $this->redirect(['messages/inbox']);
        }

        $reply = Message::find()->where([Message::tableName() . '.id' => $id])->joinWith([
                'messageReceivers' => function ($q) use ($podiumUser) {
                    $q->where(['receiver_id' => $podiumUser->id]);
                }])->limit(1)->one();
        if (empty($reply)) {
            $this->error(Yii::t('podium/flash', 'Sorry! We can not find the message with the given ID.'));
            return $this->redirect(['messages/inbox']);
        }

        $model = new Message();
        $model->topic = Message::re() . ' ' . $reply->topic;
        if ($model->load(Yii::$app->request->post())) {
            if ($model->validate()) {
                if (!$podiumUser->isIgnoredBy($model->receiversId[0])) {
                    $model->replyto = $reply->id;
                    if ($model->send()) {
                        $this->success(Yii::t('podium/flash', 'Message has been sent.'));
                        return $this->redirect(['messages/inbox']);
                    }
                    $this->error(Yii::t('podium/flash', 'Sorry! There was some error while sending your message.'));
                } else {
                    $this->error(Yii::t('podium/flash', 'Sorry! This member ignores you so you can not send the message.'));
                }
            }
        }
        $model->receiversId = [$reply->sender_id];
        return $this->render('reply', ['model' => $model, 'reply' => $reply]);
    }
457027
public function getMessage($id)
    {
        $header = $this->_protocol->top($id);
        $message = $this->_protocol->retrieve($id);

        return new Message($header, $message, $id);
    }