commerce_amws-8.x-1.x-dev/src/Entity/Store.php
src/Entity/Store.php
<?php
namespace Drupal\commerce_amws\Entity;
use Drupal\Core\Config\Entity\ConfigEntityBase;
use Drupal\commerce_amws\Entity\ConfigEntityPublishedTrait;
/**
* Defines the configuration entity for an Amazon MWS store.
*
* @ConfigEntityType(
* id = "commerce_amws_store",
* label = @Translation("Amazon MWS store"),
* label_collection = @Translation("Amazon MWS stores"),
* label_singular = @Translation("Amazon MWS store"),
* label_plural = @Translation("Amazon MWS stores"),
* label_count = @PluralTranslation(
* singular = "@count Amazon MWS store",
* plural = "@count Amazon MWS stores",
* ),
* handlers = {
* "list_builder" = "Drupal\commerce_amws\StoreListBuilder",
* "form" = {
* "add" = "Drupal\commerce_amws\Form\StoreForm",
* "edit" = "Drupal\commerce_amws\Form\StoreForm",
* },
* "route_provider" = {
* "default" = "Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider",
* },
* },
* admin_permission = "administer commerce_amws",
* config_prefix = "commerce_amws_store",
* entity_keys = {
* "id" = "id",
* "label" = "label",
* "uuid" = "uuid",
* "published" = "status",
* },
* config_export = {
* "id",
* "uuid",
* "label",
* "description",
* "seller_id",
* "marketplace_id",
* "lwa_client_id",
* "lwa_client_secret",
* "lwa_refresh_token",
* "aws_access_key_id",
* "aws_secret_access_key",
* },
* links = {
* "add-form" = "/admin/commerce/config/amazon-mws/stores/add",
* "edit-form" = "/admin/commerce/config/amazon-mws/stores/{commerce_amws_store}/edit",
* "collection" = "/admin/commerce/config/amazon-mws/stores",
* }
* )
*/
class Store extends ConfigEntityBase implements StoreInterface {
use ConfigEntityPublishedTrait;
/**
* The configuration entity ID.
*
* @var string
*/
protected $id;
/**
* A human-friendly label for the store.
*
* @var string
*/
protected $label;
/**
* A description for the store.
*
* @var string
*/
protected $description;
/**
* The seller ID.
*
* @var string
*/
protected $seller_id;
/**
* The marketplace ID.
*
* @var string
*/
protected $marketplace_id;
/**
* The LWA client ID.
*
* @var string
*/
protected $lwa_client_id;
/**
* The LWA client secret.
*
* @var string
*/
protected $lwa_client_secret;
/**
* The LWA refresh token.
*
* @var string
*/
protected $lwa_refresh_token;
/**
* The AWS access key ID.
*
* @var string
*/
protected $aws_access_key_id;
/**
* The AWS secret access key.
*
* @var string
*/
protected $aws_secret_access_key;
/**
* {@inheritdoc}
*/
public function setLabel($label) {
$this->label = $label;
return $this;
}
/**
* {@inheritdoc}
*/
public function getDescription() {
return $this->description;
}
/**
* {@inheritdoc}
*/
public function setDescription($description) {
$this->description = $description;
return $this;
}
/**
* {@inheritdoc}
*/
public function getSellerId() {
return $this->seller_id;
}
/**
* {@inheritdoc}
*/
public function setSellerId($seller_id) {
$this->seller_id = $seller_id;
return $this;
}
/**
* {@inheritdoc}
*/
public function getMarketplaceId() {
return $this->marketplace_id;
}
/**
* {@inheritdoc}
*/
public function setMarketplaceId($marketplace_id) {
$this->marketplace_id = $marketplace_id;
return $this;
}
/**
* {@inheritdoc}
*/
public function getLwaClientId() {
return $this->lwa_client_id;
}
/**
* {@inheritdoc}
*/
public function setLwaClientId($lwa_client_id) {
$this->lwa_client_id = $lwa_client_id;
return $this;
}
/**
* {@inheritdoc}
*/
public function getLwaClientSecret() {
return $this->lwa_client_secret;
}
/**
* {@inheritdoc}
*/
public function setLwaClientSecret($lwa_client_secret) {
$this->lwa_client_secret = $lwa_client_secret;
return $this;
}
/**
* {@inheritdoc}
*/
public function getLwaRefreshToken() {
return $this->lwa_refresh_token;
}
/**
* {@inheritdoc}
*/
public function setLwaRefreshToken($lwa_refresh_token) {
$this->lwa_refresh_token = $lwa_refresh_token;
return $this;
}
/**
* {@inheritdoc}
*/
public function getAwsAccessKeyId() {
return $this->aws_access_key_id;
}
/**
* {@inheritdoc}
*/
public function setAwsAccessKeyId($aws_access_key_id) {
$this->aws_access_key_id = $aws_access_key_id;
return $this;
}
/**
* {@inheritdoc}
*/
public function getAwsSecretAccessKey() {
return $this->aws_secret_access_key;
}
/**
* {@inheritdoc}
*/
public function setAwsSecretAccessKey($aws_secret_access_key) {
$this->aws_secret_access_key = $aws_secret_access_key;
return $this;
}
}
