View source
<?php
namespace Drupal\lingotek;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
class LingotekIntelligenceServiceConfig implements LingotekIntelligenceMetadataInterface, ContainerInjectionInterface {
protected $configFactory;
public function __construct(ConfigFactoryInterface $config_factory) {
$this->configFactory = $config_factory;
}
public static function create(ContainerInterface $container) {
return new static($container
->get('config.factory'));
}
public function getBusinessUnit() {
return $this
->getValue('business_unit');
}
public function setBusinessUnit($business_unit) {
return $this
->setValue('business_unit', $business_unit);
}
public function getBusinessDivision() {
return $this
->getValue('business_division');
}
public function setBusinessDivision($business_division) {
return $this
->setValue('business_division', $business_division);
}
public function getCampaignId() {
return $this
->getValue('campaign_id');
}
public function setCampaignId($campaign_id) {
return $this
->setValue('campaign_id', $campaign_id);
}
public function getCampaignRating() {
return $this
->getValue('campaign_rating');
}
public function setCampaignRating($campaign_rating) {
return $this
->setValue('campaign_rating', $campaign_rating);
}
public function getChannel() {
return $this
->getValue('channel');
}
public function setChannel($channel) {
return $this
->setValue('channel', $channel);
}
public function getContactName() {
return $this
->getValue('contact_name');
}
public function setContactName($contact_name) {
return $this
->setValue('contact_name', $contact_name);
}
public function getContactEmail() {
return $this
->getValue('contact_email');
}
public function setContactEmail($contact_email) {
return $this
->setValue('contact_email', $contact_email);
}
public function getContentDescription() {
return $this
->getValue('content_description');
}
public function setContentDescription($content_description) {
return $this
->setValue('content_description', $content_description);
}
public function getPurchaseOrder() {
return $this
->getValue('purchase_order');
}
public function setPurchaseOrder($purchase_order) {
return $this
->setValue('purchase_order', $purchase_order);
}
public function getExternalStyleId() {
return $this
->getValue('external_style_id');
}
public function setExternalStyleId($external_style_id) {
return $this
->setValue('external_style_id', $external_style_id);
}
public function getRegion() {
return $this
->getValue('region');
}
public function setRegion($region) {
return $this
->setValue('region', $region);
}
public function getAuthorPermission() {
$value = NULL;
$config = $this->configFactory
->get('lingotek.settings');
return $config
->get('intelligence.use_author');
}
public function setAuthorPermission($use_author) {
return $this
->setValue('use_author', $use_author);
}
public function getDefaultAuthorEmail() {
$value = NULL;
$config = $this->configFactory
->get('lingotek.settings');
if ($config
->get('intelligence.use_author_email')) {
$value = $config
->get('intelligence.default_author_email');
}
return $value;
}
public function setDefaultAuthorEmail($default_author_email) {
return $this
->setValue('default_author_email', $default_author_email);
}
public function getAuthorEmailPermission() {
$config = $this->configFactory
->get('lingotek.settings');
return $config
->get('intelligence.use_author_email');
}
public function setAuthorEmailPermission($use_author_email) {
return $this
->setValue('use_author_email', $use_author_email);
}
public function getContactEmailForAuthorPermission() {
$config = $this->configFactory
->get('lingotek.settings');
return $config
->get('intelligence.use_contact_email_for_author');
}
public function setContactEmailForAuthorPermission($use_contact_email_for_author) {
return $this
->setValue('use_contact_email_for_author', $use_contact_email_for_author);
}
public function getBusinessUnitPermission() {
$config = $this->configFactory
->get('lingotek.settings');
return $config
->get('intelligence.use_business_unit');
}
public function setBusinessUnitPermission($use_business_unit) {
return $this
->setValue('use_business_unit', $use_business_unit);
}
public function getBusinessDivisionPermission() {
$config = $this->configFactory
->get('lingotek.settings');
return $config
->get('intelligence.use_business_division');
}
public function setBusinessDivisionPermission($use_business_division) {
return $this
->setValue('use_business_division', $use_business_division);
}
public function getCampaignIdPermission() {
$config = $this->configFactory
->get('lingotek.settings');
return $config
->get('intelligence.use_campaign_id');
}
public function setCampaignIdPermission($use_campaign_id) {
return $this
->setValue('use_campaign_id', $use_campaign_id);
}
public function getCampaignRatingPermission() {
$config = $this->configFactory
->get('lingotek.settings');
return $config
->get('intelligence.use_campaign_rating');
}
public function setCampaignRatingPermission($use_campaign_rating) {
return $this
->setValue('use_campaign_rating', $use_campaign_rating);
}
public function getChannelPermission() {
$config = $this->configFactory
->get('lingotek.settings');
return $config
->get('intelligence.use_channel');
}
public function setChannelPermission($use_channel) {
return $this
->setValue('use_channel', $use_channel);
}
public function getContactNamePermission() {
$config = $this->configFactory
->get('lingotek.settings');
return $config
->get('intelligence.use_contact_name');
}
public function setContactNamePermission($use_contact_name) {
return $this
->setValue('use_contact_name', $use_contact_name);
}
public function getContactEmailPermission() {
$config = $this->configFactory
->get('lingotek.settings');
return $config
->get('intelligence.use_contact_email');
}
public function setContactEmailPermission($use_contact_email) {
return $this
->setValue('use_contact_email', $use_contact_email);
}
public function getContentDescriptionPermission() {
$config = $this->configFactory
->get('lingotek.settings');
return $config
->get('intelligence.use_content_description');
}
public function setContentDescriptionPermission($use_content_description) {
return $this
->setValue('use_content_description', $use_content_description);
}
public function getExternalStyleIdPermission() {
$config = $this->configFactory
->get('lingotek.settings');
return $config
->get('intelligence.use_external_style_id');
}
public function setExternalStyleIdPermission($use_external_style_id) {
return $this
->setValue('use_external_style_id', $use_external_style_id);
}
public function getPurchaseOrderPermission() {
$config = $this->configFactory
->get('lingotek.settings');
return $config
->get('intelligence.use_purchase_order');
}
public function setPurchaseOrderPermission($use_purchase_order) {
return $this
->setValue('use_purchase_order', $use_purchase_order);
}
public function getRegionPermission() {
$config = $this->configFactory
->get('lingotek.settings');
return $config
->get('intelligence.use_region');
}
public function setRegionPermission($use_region) {
return $this
->setValue('use_region', $use_region);
}
public function getBaseDomainPermission() {
$config = $this->configFactory
->get('lingotek.settings');
return $config
->get('intelligence.use_base_domain');
}
public function setBaseDomainPermission($use_base_domain) {
return $this
->setValue('use_base_domain', $use_base_domain);
}
public function getReferenceUrlPermission() {
$config = $this->configFactory
->get('lingotek.settings');
return $config
->get('intelligence.use_reference_url');
}
public function setReferenceUrlPermission($use_reference_url) {
return $this
->setValue('use_reference_url', $use_reference_url);
}
protected function getValue($key) {
$value = NULL;
$config = $this->configFactory
->get('lingotek.settings');
if ($config
->get('intelligence.use_' . $key)) {
$value = $config
->get('intelligence.' . $key);
}
return $value;
}
protected function setValue($key, $value) {
$config = $this->configFactory
->getEditable('lingotek.settings');
$config
->set('intelligence.' . $key, $value);
$config
->save();
return $this;
}
}