Skip to content

Commit

Permalink
定数を利用するためにステートマシンの定義をphpファイルに移行
Browse files Browse the repository at this point in the history
  • Loading branch information
kiy0taka committed Jul 13, 2018
1 parent 2e2bd9a commit d24af7d
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 48 deletions.
48 changes: 0 additions & 48 deletions app/config/eccube/packages/order_state.yaml

This file was deleted.

69 changes: 69 additions & 0 deletions app/config/eccube/packages/order_state_machine.php
@@ -0,0 +1,69 @@
<?php

/*
* This file is part of EC-CUBE
*
* Copyright(c) LOCKON CO.,LTD. All Rights Reserved.
*
* http://www.lockon.co.jp/
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

use Eccube\Entity\Order;
use Eccube\Entity\Master\OrderStatus as Status;

$container->loadFromExtension('framework', [
'workflows' => [
'order' => [
'type' => 'state_machine',
'marking_store' => [
'type' => 'single_state',
'arguments' => 'OrderStatus.id',
],
'supports' => [
Order::class,
],
'initial_place' => (string) Status::NEW,
'places' => [
(string) Status::NEW,
(string) Status::PAID,
(string) Status::IN_PROGRESS,
(string) Status::CANCEL,
(string) Status::DELIVERED,
(string) Status::RETURNED,
],
'transitions' => [
'pay' => [
'from' => (string) Status::NEW,
'to' => (string) Status::PAID,
],
'packing' => [
'from' => [(string) Status::NEW, (string) Status::PAID],
'to' => (string) Status::IN_PROGRESS,
],
'cancel' => [
'from' => [(string) Status::NEW, (string) Status::IN_PROGRESS],
'to' => (string) Status::CANCEL,
],
'back_to_in_progress' => [
'from' => (string) Status::CANCEL,
'to' => (string) Status::IN_PROGRESS,
],
'ship' => [
'from' => [(string) Status::NEW, (string) Status::PAID, (string) Status::IN_PROGRESS],
'to' => [(string) Status::DELIVERED],
],
'return' => [
'from' => (string) Status::DELIVERED,
'to' => (string) Status::RETURNED,
],
'cancel_return' => [
'from' => (string) Status::RETURNED,
'to' => (string) Status::DELIVERED,
],
],
],
],
]);

0 comments on commit d24af7d

Please sign in to comment.