Cake\ORM\Table::loadInto PHP Method

loadInto() public method

### Example: $user = $usersTable->get(1); $user = $usersTable->loadInto($user, ['Articles.Tags', 'Articles.Comments']); echo $user->articles[0]->title; You can also load associations for multiple entities at once ### Example: $users = $usersTable->find()->where([...])->toList(); $users = $usersTable->loadInto($users, ['Articles.Tags', 'Articles.Comments']); echo $user[1]->articles[0]->title; The properties for the associations to be loaded will be overwritten on each entity.
See also: Cake\ORM\Query::contain()
public loadInto ( Cake\Datasource\EntityInterface | array $entities, array $contain ) : Cake\Datasource\EntityInterface | array
$entities Cake\Datasource\EntityInterface | array a single entity or list of entities
$contain array A `contain()` compatible array.
return Cake\Datasource\EntityInterface | array
    public function loadInto($entities, array $contain)
    {
        return (new LazyEagerLoader())->loadInto($entities, $contain, $this);
    }