public function afterSelect(Select $event)
    {
        if ($this->lazyLoad) {
            return;
        }
        $data = $event->data;
        $multiple = $data instanceof RecordList;
        if ($multiple) {
            $data = $event->data->getArrayCopy();
        } else {
            $data = [$data];
        }
        if (empty($data)) {
            return;
        }
        $related = Entity\Manager::getInstance()
            ->get($this->getRelatedEntity());
        $relatedTable = $related->getEntity()->getTableName();
        $class = $related->getEntity()->getClassName();
        $dataCopy = $data;
        foreach ($dataCopy as $key => $row) {

            $pmk =  $this->getEntity()->getPrimaryKey();
            if (isset($row[$pmk]) && is_array($row[$pmk])) {
                $data[$key][$pmk] = reset($row[$pmk]);
            }
            $options = [];
            if (is_array($row)) {
                foreach ($row as $column => $value) {
                    if (preg_match('/^' . $relatedTable . '_(.*)/', $column)) {
                        unset($data[$key][$column]);
                        $name = str_replace($relatedTable . '_', '', $column);
                        $options[$name] = $value;
                    }
                }
            }
            $data[$key][$this->getPropertyName()] = new $class($options);
        }

        if ($multiple) {
            $event->data = new RecordList(['data' => $data]);
        } else {
            $event->data = reset($data);
        }
    }