Mae Cana
Mae Cana

Reputation: 43

CakePHP: Database Association 1-to-Many link to 1-to-1

3 tables:

PaymentRequests
PaymentPurchaseOrders
PurchaseOrders

Current Relationship:

PaymentRequests -> HasMany -> PaymentPurchaseOrders -> BelongsTo ->PurchaseOrders

Current Codes on Controller:

$Get = $this->PaymentRequests->find(
    'all', [
        'contain'=>['PaymentPurchaseOrder'=>['PurchaseOrder']
    ]);

Problem:

This is too heavy a query. I want to just associate this in model but i do not know how.

Upvotes: 0

Views: 47

Answers (0)

Related Questions