そーと
<?php // オブジェクトのソートについて $config_all = Hoge::findAll(); //こんな感じ usort($config_all, function($a,$b) { return ($b->getPointBegin() - $a->getPointBegin()); } ); //これもあり //これでやってたけど、上のほうがいいっぽい //point_beginの小さい順にソートする $point_begin = array(); foreach($config_all as $key => $config) { $point_begin[$key] = $config->getPointBegin(); } array_multisort( $point_begin, SORT_ASC, $config_all );
PHP5.3、無名関数をさくっと使えていいな、と思いました