获取最近的会话.

@return EntityCollection|Entity\Recent[]
422646
public function getRecentList()
    {
        $request = new Request\GetRecentListRequest($this->getCredential());
        $response = $this->sendRequest($request);

        return Request\GetRecentListRequest::parseResponse($response);
    }
1124781
public function current()
	{
		if( !isset( $this->____pairs ) )
			$this->getPairs();
		$values	= array_values( $this->____pairs );
		return $values[$this->____cursor];
	}
84989
public function getOldRelations()
    {
        $oldRelations = [];
        foreach ($this->_relations as $relationName) {
            $oldRelations[$relationName] = $this->getOldRelation($relationName);
        }
        return $oldRelations;
    }
1059008
protected function getNewPosts()
    {
        Container::get('hooks')->fire('model.index.get_new_posts_start');

        $query['select'] = ['f.id', 'f.last_post'];
        $query['where'] = [
            ['fp.read_forum' => 'IS NULL'],
            ['fp.read_forum' => '1']
        ];
        $query = DB::forTable('forums')
            ->table_alias('f')
            ->select_many($query['select'])
            ->left_outer_join(
                DB::prefix().'forum_perms',
                '(`fp`.`forum_id`=`f`.`id` AND `fp`.`group_id`='.User::get()->g_id.')',
                'fp'
            )
//            ->left_outer_join(DB::prefix().'forum_perms', array('fp.forum_id', '=', 'f.id'), 'fp')
//            ->left_outer_join(DB::prefix().'forum_perms', array('fp.group_id', '=',
// User::get()->g_id), null, true)
//            ->where_any_is($query['where'])
            ->where_raw('(fp.read_forum IS NULL OR fp.read_forum = 1)')
            ->where_gt('f.last_post', User::get()->last_visit);

        $query = Container::get('hooks')->fireDB('model.index.query_get_new_posts', $query);

        $query = $query->find_result_set();

        $forums = $new_topics = [];
        $tracked_topics = Track::getTrackedTopics();

        foreach ($query as $cur_forum) {
            if (!isset($tracked_topics['forums'][$cur_forum->id]) ||
                $tracked_topics['forums'][$cur_forum->id] < $cur_forum->last_post) {
                $forums[$cur_forum->id] = $cur_forum->last_post;
            }
        }

        if (!empty($forums)) {
            if (empty($tracked_topics['topics'])) {
                $new_topics = $forums;
            } else {
                $query['select'] = ['forum_id', 'id', 'last_post'];

                $query = DB::forTable('topics')
                    ->select_many($query['select'])
                    ->where_in('forum_id', array_keys($forums))
                    ->where_gt('last_post', User::get()->last_visit)
                    ->where_null('moved_to');

                $query = Container::get('hooks')->fireDB('model.index.get_new_posts_query', $query);

                $query = $query->find_result_set();

                foreach ($query as $cur_topic) {
                    if (!isset($new_topics[$cur_topic->forum_id]) &&
                        (!isset($tracked_topics['forums'][$cur_topic->forum_id]) ||
                            $tracked_topics['forums'][$cur_topic->forum_id] < $forums[$cur_topic->forum_id]) &&
                        (!isset($tracked_topics['topics'][$cur_topic->id]) ||
                            $tracked_topics['topics'][$cur_topic->id] < $cur_topic->last_post)) {
                        $new_topics[$cur_topic->forum_id] = $forums[$cur_topic->forum_id];
                    }
                }
            }
        }

        $new_topics = Container::get('hooks')->fire('model.index.get_new_posts', $new_topics);

        return $new_topics;
    }
19698
public function getErrors()
    {
        $errors = array();

        $entityContainers = $this->getEntityContainerMap()->getAll();

        /**
         * @var EntityContainerInterface $entityContainer
         */
        foreach ($entityContainers as $entityContainer) {
            if ($entityContainer->hasErrors()) {
                $errors[$entityContainer->getName()] = $entityContainer->getErrors();
            }
        }

        return $errors;
    }
1067928
public function getChangedFields() {
        if($this->isAfterSave() && method_exists($this->getEntity(), 'getUpdatedFields')) {
            if($this->getEntity()->hasSnapshotData()) {
                $actualChangedFields = $this->getEntity()->getUpdatedFields();
            } else {
                $actualChangedFields = $this->getSnapshotData();
            }
        } else { //Legacy
            $actualChangedFields = $this->getEntity()->getChangedFields();
        }
        $model = $this->getEntity();
        foreach($actualChangedFields as $index => $changedField) {
            $newValue = $model->readAttribute($changedField);
            if(is_array($newValue)) {
                $newValue = json_encode($newValue);
            }
            $oldValue = $this->getSnapshotData()[$changedField] ?? null ?? null;
            if(is_object($oldValue)) {
                $oldValue = (string)$oldValue;
            }
            if(is_object($newValue)) {
                $newValue = (string)$newValue;
            }
            if(is_bool($oldValue) || is_bool($newValue)){
                $oldValue = (bool) $oldValue;
                $newValue = (bool) $newValue;
            }
            if($oldValue === $newValue) {
                unset($actualChangedFields[$index]);
            }

        }
        return array_values($actualChangedFields);
    }
1311621
public function getResults()
    {
        if ($this->_children === null) {
            $this->_children = $this->getFreshResults();
        }
        return $this->_children;
    }
795138
public function getPhones()
    {
        $entities = [];
        if ($this->entity->getPhones()) {
            foreach ($this->entity->getPhones() as $phone) {
                $entities[] = $phone;
            }
        }

        return $entities;
    }
744476
public function getAllNotDeleted(): array
    {
        if (!$this->entityImplements(SoftDeleteInterface::class)) {
            throw new \Exception(sprintf('Entities of class "%s" do not implement interface "%s"', $this->getEntityClassName(), SoftDeleteInterface::class));
        }

        return $this->getEntitiesBy(['deleted' => false]);
    }
68952
public static function entityList()
    {
        $files = File::files(config_path('panel'));

        $list = [];
        foreach ($files as $file) {
            $list[] = new self($file);
        }

        return collect($list)->sortBy(function ($entity) {
            return $entity->name();
        });
    }
101298
public function getList()
    {
        $objects = $this->manager->findAll();
        $this->addPaginationData($objects);
        $objects = $objects->getItems();
        if (empty($objects)) {
            $this->addInfoMessage(self::INFO_NO_ENTRIES_FOUND);
        }
        return $objects;
    }
161905
public function with()
    {
        $recentOrder = null;

        $order = app(OrderInterface::class);

        $latestOrder = $order->query()->orderBy('id', 'desc')->first();
        if ($latestOrder !== null) {
            $totalAmount = '';
            foreach ($latestOrder->products as $product) {
                $totalAmount = $product->getRelationValue('pivot')->qty * $product->getRelationValue('pivot')->price;
            }

            $recentOrder['order_id'] = $latestOrder->id;
            $recentOrder['user'] = $latestOrder->user->fullName;
            $recentOrder['customer_id'] = $latestOrder->user->id;
            $recentOrder['product_count'] = $latestOrder->products->count();
            $recentOrder['total_amount'] = $totalAmount;
            $recentOrder['status'] = $latestOrder->orderStatus->name;
        }

        return ['recentOrderData' => $recentOrder];
    }
797975
public function getCollection()
    {
        $queueDatabase = $this->database;
        $queueResource = $this->collection;
        $db = $this->getAdapter();

        return $db->$queueDatabase->$queueResource;
    }
1279220
public function getScopes()
    {
        if (!isset($this->_scopes)) {
            $this->_scopes = clone $this->getService('com:components.domain.entityset.scope');
        }

        return $this->_scopes;
    }
1186902
private function &getCollection()
    {
        if (null === $this->collection) {
            $qb = $this->createAndFilterQueryBuilder($this->getEntityAlias());
            if ($this->isHydrationDisabled()) {
                $this->collection = $qb->getQuery()->getScalarResult();
            } else {
                $this->collection = $qb->getQuery()->getResult();
            }
        }
        return $this->collection;
    }
359813
public function last() {
    $matches = [];
    if (!empty($this->nodes)) {
      $matches[] = $this->nodes[count($this->nodes) - 1];
    }
    return new NodeCollection($matches, FALSE);
  }
419178
public function collection()
    {
        if (!empty($this->response['data'])) {
            $data = [];

            foreach ($this->response['data'] as $object) {
                $data[] = new Fluent($this->resource, $object);
            }

            return $data;
        }

        return [];
    }