Skip to content

Fix second params of findOneBy in file Abstract #139

@angie-laurenti

Description

@angie-laurenti

When I generate DAOs, in files like Abstract (no editable), DAO can generate function findOneBy .. like this for example in AbstractDocumentTypeDao :

    /**
     * Get a DocumentType filtered by whiteLabel, documentModels.
     *
     * @param WhiteLabel $whiteLabel
     * @param DocumentModel $documentModels
     * @param string[] $additionalTablesFetch A list of additional tables to fetch (for performance improvement)
     * @return DocumentType|null
     */
    public function findOneByWhiteLabelAndDocumentModels(WhiteLabel $whiteLabel, ?DocumentModel $documentModels = null, array $additionalTablesFetch = array()) : ?DocumentType
    {
        $filter = [
            'white_label_id' => $whiteLabel->getId(),
            'document_models_id' => ($documentModels !== null) ? $documentModels->getId() : null,
        ];
        return $this->findOne($filter, [], $additionalTablesFetch);
    }

In my schema DB, white_label_id and document_models_id are NOT NULL

So, second params should not be an optional parameter.

Can it be corrected? Thank you

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions