Skip to content

$modelAlias empty in construct #1476

Open
@Sadrak

Description

@Sadrak
class PurchaseArticleQuery extends BasePurchaseArticleQuery
{
    /**
     * Initializes internal state of PurchaseQuery object.
     *
     * @param     string $dbName The dabase name (optional)
     * @param     string $modelName The phpName of a model, e.g. 'Book' (optional)
     * @param     string $modelAlias The alias for the model in this query, e.g. 'b' (optional)
     */
    public function __construct($dbName = 'test', $modelName = '\\PurchaseArticle', $modelAlias = null)
    {
        parent::__construct($dbName, $modelName, $modelAlias);

        $this->orderById();
    }

} // PurchaseArticleQuery
$item = DomainQuery::create()
->usePurchaseArticleQuery('PurchaseArticleTest')
->endUse()
->find()

This is not working. The join condition use the correct alias but the ORDER BY SQL is not using the alias. The $modelAlias Variable in __construct is empty.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions