public function insert($config)
    {
        if (is_string($config)) {
            $config = array('name' => $config);
        }

        $config = new AnConfig($config);

        if (empty($config->link) && !empty($this->_resources)) {
            $name = AnInflector::singularize($this->main()->getName());
            $config->link = array('child' => $name.'_id','parent' => 'id');
        }

        $config->append(array(
            'columns' => $this->_store->getColumns($config->name),
        ));

        $resource = new AnDomainResource($config);
        $this->_resources[$resource->getAlias()] = $resource;

        return $this;
    }