mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-02-24 09:42:24 +01:00
38 lines
677 B
PHP
38 lines
677 B
PHP
<?php
|
|
|
|
namespace DesignPatterns\Status;
|
|
|
|
/**
|
|
* Class OrderController
|
|
*/
|
|
class OrderController
|
|
{
|
|
/**
|
|
* @param int $id
|
|
*/
|
|
public function shipAction($id)
|
|
{
|
|
$order = OrderFactory::getOrder($id);
|
|
try {
|
|
$order->shipOrder($id);
|
|
} catch (Exception $e) {
|
|
//handle error!
|
|
}
|
|
// response to browser
|
|
}
|
|
|
|
/**
|
|
* @param int $id
|
|
*/
|
|
public function completeAction($id)
|
|
{
|
|
$order = OrderFactory::getOrder($id);
|
|
try {
|
|
$order->completeOrder($id);
|
|
} catch (Exception $e) {
|
|
//handle error!
|
|
}
|
|
// response to browser
|
|
}
|
|
}
|