2013-11-09 11:06:04 +01:00
|
|
|
<?php
|
|
|
|
|
2013-11-12 15:48:25 +01:00
|
|
|
namespace ManiaControl\Manialinks;
|
2013-11-09 11:06:04 +01:00
|
|
|
|
|
|
|
/**
|
2013-11-10 17:23:00 +01:00
|
|
|
* Handler for manialink ids
|
2013-11-09 11:06:04 +01:00
|
|
|
*
|
2013-11-10 17:23:00 +01:00
|
|
|
* @author kremsy & steeffeen
|
2013-11-09 11:06:04 +01:00
|
|
|
*/
|
2013-11-10 17:23:00 +01:00
|
|
|
class ManialinkIdHandler {
|
|
|
|
/**
|
|
|
|
* Private properties
|
|
|
|
*/
|
|
|
|
private $maniaLinkIdCount = 0;
|
2013-11-09 11:06:04 +01:00
|
|
|
|
2013-11-10 17:23:00 +01:00
|
|
|
/**
|
|
|
|
* Reserve manialink ids
|
2013-11-09 12:20:38 +01:00
|
|
|
*
|
2013-11-10 17:23:00 +01:00
|
|
|
* @param int $count
|
|
|
|
* @return array with manialink Ids
|
2013-11-09 12:20:38 +01:00
|
|
|
*/
|
2013-11-10 17:23:00 +01:00
|
|
|
public function reserveManiaLinkIds($count) {
|
|
|
|
$mlIds = array();
|
|
|
|
for ($i = 0; $i < $count; $i++) {
|
|
|
|
array_push($mlIds, ++$this->maniaLinkIdCount);
|
|
|
|
}
|
|
|
|
return $mlIds;
|
|
|
|
}
|
|
|
|
}
|
2013-11-12 15:48:25 +01:00
|
|
|
|
|
|
|
?>
|