假設三個表中,下述關聯的數據庫:PHP Activerecord對象數組,下一步是什麼?
//working with three tables a client 'has one' business
//and a business has many business hours.
下面將給我們一個陣列的ActiveRecord的對象:
$this->client->business->businesshours
,我們將不得不拉一個對象形成陣列以獲得其列值:
$this->client->business->businesshours[0]->start_time
由於我是PHP Activerecord的新手,除了使用foreach()循環循環外,還有哪些方法可以從一組對象中抽取/排序/使用信息?是否有方法通過對象數組排序,根據列值提取信息,以及任何最佳實踐?