protected function assertArrayAccess($container)
    {
        if (!$container instanceof \Traversable && !is_array($container)) {
            throw new RelationException(sprintf('Relation container must be array or instance of ArrayAccess, got %s', $this->getType($container)));
        }
    }