public static function down(DAOConnected $object, LogicalObject $exp = null) { $getMethod = 'get' . ucfirst(self::$property); Assert::isTrue(method_exists($object, $getMethod)); $oldPosition = $object->{$getMethod}(); $criteria = Criteria::create($object->dao())->add(Expression::gt(self::$property, $oldPosition))->addOrder(OrderBy::create(self::$property)->asc())->setLimit(1); if ($exp) { $criteria->add($exp); } if ($lowerObject = $criteria->get()) { DaoUtils::setNullValue(self::$nullValue); DaoUtils::swap($lowerObject, $object, self::$property); } }
public static function setNullValue($nullValue) { self::$nullValue = $nullValue; }