/** * Array sorting callback method to place the 'unallocated' ISC_QUOTE_ADDRESS first as sometimes it may be created after the other addresses (e.g. when editing an order) * * @param ISC_QUOTE_ADDRESS $a * @param ISC_QUOTE_ADDRESS $b * @return int */ public static function sortUnallocatedAddressFirst(ISC_QUOTE_ADDRESS $a, ISC_QUOTE_ADDRESS $b) { if ($a->getIsUnallocated()) { return -1; } if ($b->getIsUnallocated()) { return 1; } return 0; }