protected function preloadEntities($values)
    {
        $ids = array();

        foreach ($values as $row) {
            $id = $row->{$this->field_alias};

            if ($this->view->base_table == 'node_revision') {
                $this->entities[$id] = node_load(NULL, $id);
            } else {
                $ids[$id] = $id;
            }
        }

        $base_tables = date_views_base_tables();
        $this->entity_type = $base_tables[$this->view->base_table];

        if (!empty($ids)) {
            $this->entities = entity_load($this->entity_type, $ids);
        }
    }