getId() == $actionId) { return $action; } } throw new InvalidArgumentException("Unknown action: " . $action); } /** * @return AmzFulfillment_Entity_Action[] */ public static function values() { if(self::$values === NULL) { self::$values = array( new self(self::WOOCOMMERCE_ORDER_PENDING, 'set woocommerce status to pending payment', 'WooCommerce'), new self(self::WOOCOMMERCE_ORDER_PROCESSING, 'set woocommerce status to processing', 'WooCommerce'), new self(self::WOOCOMMERCE_ORDER_ONHOLD, 'set woocommerce status to on-hold', 'WooCommerce'), new self(self::WOOCOMMERCE_ORDER_COMPLETED, 'set woocommerce status to completed', 'WooCommerce'), new self(self::WOOCOMMERCE_ORDER_CANCELLED, 'set woocommerce status to cancelled', 'WooCommerce'), new self(self::WOOCOMMERCE_ORDER_REFUNDED, 'set woocommerce status to refunded', 'WooCommerce'), new self(self::WOOCOMMERCE_ORDER_FAILED, 'set woocommerce status to failed', 'WooCommerce'), new self(self::AMAZON_FULFILLMENT_CREATE, 'create fulfillment', 'Amazon'), new self(self::AMAZON_FULFILLMENT_CANCEL, 'cancel fulfillment', 'Amazon'), new self(self::EMAIL_ADMIN, 'send email notification to wp admin', 'Notification'), new self(self::EMAIL_PACKAGE_TRACKING, 'send package tracking email', 'Notification')); } return self::$values; } private $id; private $name; private $group; private function __construct($id, $name, $group) { $this->id = $id; $this->name = $name; $this->group = $group; } /** * @return string */ public function getId() { return $this->id; } /** * @return string */ public function getName() { return $this->name; } /** * @return string */ public function getGroup() { return $this->group; } }