Q:

Select all fields from custom named aossciation

I have a query like so:
    $q = $q  
        //->select($this->LessonPupils) // Does not work
        ->select([
            'OutLessonPupils.*', //  Does not work
            'Groups.id', 
        ])
        ->where($conditions)
        ->order($order)
        ->contain([
            'Pupils',
            'Pupils. Groups',
            'Pupils. OutLessonPupils'
        ]);

I want to select all fields from the Pupils association OutLessonPupils which uses a table class of LessonPupils but I cannot seem to get it to work and I cannot find anything in the documentation about this. 
How can I select all fields from OutLessonPupils? 

A:

Need to select by calling associations ->select($this->Pupils->OutLessonPupils) your code looks like 
$q = $q->select($this->Pupils->OutLessonPupils)
        ->select([
            'Groups.id', 
        ])
        ->where($conditions)
        ->order($order)
        ->contain([
            'Pupils',
            'Pupils. Groups',
            'Pupils. OutLessonPupils'
        ]);

