public function foreign($datas = []) {
        if (!array_key_exists('type', $datas)) {
            throw new MissingEntityException('The parameter "type" is missing for the foreign key');
        }

        if (!array_key_exists('reference', $datas)) {
            throw new MissingEntityException('The parameter "reference" is missing for the foreign key');
        }

        if (!array_key_exists('belong', $datas)) {
            $datas['belong'] = ForeignKey::AGGREGATION;
        }

        if (!array_key_exists('current', $datas) || count($datas['current']) < 2) {
            $datas['current'] = [$this->entity, $this->name];
        }

        if (!array_key_exists('value', $datas)) {
            $datas['value'] = '';
        }

        if (!array_key_exists('join', $datas)) {
            $datas['join'] = Builder::JOIN_INNER;
        }

        $this->foreign = new ForeignKey($datas);

        return $this;
    }