0
저는 Zend2를 처음 사용하여 두 개의 테이블 게이트 객체를 결합하고자합니다.Zend2 결합 테이블 게이트 배열
두 테이블이 있습니다. 가격과 크기가 있습니다. 모든 가격에는 여러 크기가 있습니다. 이 테이블을 배열에 결합하고자하므로 가격을 가격으로 나열 할 수 있습니다. 내가 (그래서의 크기없이) 가격을 표시하는 방법
public function getPricesbyJewel($jewel)
{
$rowset = $this->tableGateway->select(array('jewelid' => $jewel));
return $rowset;
}
내 SizesTable.php
:
array(
1 => array(
'price' => 45,
'description' => 'Lorem ipsum',
'sizes' => array(
1 => '16',
2 => '17',
3 => '20',
4 => '21'
)
),
2 => array(
'price' => 50,
'description' => 'Lorem ipsum',
'sizes' => array(
1 => '34',
2 => '12',
3 => '21',
4 => '50'
)
)
)
내 PricesTable.php : 예를 들어
$jewelPrices = array('jewelryPrices' => $this->getPricesTable()->getPricesbyJewel($jewel->id));
$jewelSizes = array('jewelrySizes' => $this->getSizesTable()->getSizesbyPrice($priceID);
크기를 컨트롤러에있는 테이블의 배열로 가격에 나열하는 방법은 무엇입니까?
이 시도 http://stackoverflow.com/questions/14354802/tablegateway-with -multiple-from-tables? rq = 1 – Ruwantha