##現状
PHP 7.2
CakePHP 3.x系を使用して開発をしています
object(App\Model\Entity\Aaa) { 'id' => (int) 477, 'title' => 'aaa', }
[ (int) 1 => object(App\Model\Entity\Aaa) { 'id' => (int) 242, 'title' => 'bbb', }, ]
このような2つのオブジェクト型の連想配列が存在していて、これらを一つに結合したいのですが、分からず詰まっています。
期待値としては、
object(App\Model\Entity\Aaa) { (int) 1 => object(App\Model\Entity\Aaa) { 'id' => (int) 242, 'title' => 'bbb', }, (int) 2 => object(App\Model\Entity\Aaa) { 'id' => (int) 477, 'title' => 'aaa', }, }
このような形を想定しています。
##質問事項
- 期待値となるコードを教えて頂きたいです。
不明点等ありましたら、コメント下さい。
ご回答よろしくお願い致します。
あなたの回答
tips
プレビュー