Reputation: 301
Is it possible to combine assoaciate table as Union? To display it all together with conditions
$this->paginate = [
'contain' => ['Users', 'Posts', 'Comment', 'likes'],
];
$tweets = $this->paginate($this->lists);
Something like in query builder so I can also add condition for posts and comments
$table1 = $this->tableName
->find()
->join()
->where()
$table2 = $this->tableName
->find()
->join()
->where()
$Union->Union($table1)
Upvotes: 1
Views: 75
Reputation: 10922
Something like the following would do using unions
$table1 = $this->tableName
->find()
->join()
->where()
$table2 = $this->tableName
->find()
->join()
->where()
$table2->union($table1);
Upvotes: 1