public function getRelationType($component)
    {
        $types = array('has_one', 'has_many', 'many_many', 'belongs_many_many', 'belongs_to');
        $config = $this->config();
        foreach ($types as $type) {
            $relations = $config->get($type);
            if ($relations && isset($relations[$component])) {
                return $type;
            }
        }
        return null;
    }