protected function addGetDecorator()
    {
        $this->addDecorator(function ($result) {
            if (!empty($this->className) && !empty($result)) {
                $entities = EntityHelper::listToEntity($result, $this->className);

                return new Collection($entities);
            }

            if (!empty($result) && empty($this->join) && !empty($this->className)) {
                $tableName = $this->getTableName();
                $result    = EntityHelper::formatListByType($result, $tableName);
            }

            return $result;
        });
    }