オブジェクトのコレクションがあり、作成日を比較して最新のものを選択するメソッドが必要です。
public function getCoverImage(){
foreach($this->getImages() as $image){
}
}
で日付にアクセスできます
$image->getCreatedAt()
DateTime オブジェクトを返します。それを行う方法についてのアイデアはありますか?
オブジェクトのコレクションがあり、作成日を比較して最新のものを選択するメソッドが必要です。
public function getCoverImage(){
foreach($this->getImages() as $image){
}
}
で日付にアクセスできます
$image->getCreatedAt()
DateTime オブジェクトを返します。それを行う方法についてのアイデアはありますか?