Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 6 |
CRAP | |
0.00% |
0 / 15 |
ContactForm | |
0.00% |
0 / 1 |
|
0.00% |
0 / 6 |
42 | |
0.00% |
0 / 15 |
getRecipients | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
setRecipients | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 3 |
|||
getReply | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
setReply | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 3 |
|||
getWeight | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
setWeight | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 3 |
<?php | |
/** | |
* @file | |
* Contains \Drupal\contact\Entity\ContactForm. | |
*/ | |
namespace Drupal\contact\Entity; | |
use Drupal\Core\Config\Entity\ConfigEntityBundleBase; | |
use Drupal\contact\ContactFormInterface; | |
/** | |
* Defines the contact form entity. | |
* | |
* @ConfigEntityType( | |
* id = "contact_form", | |
* label = @Translation("Contact form"), | |
* handlers = { | |
* "access" = "Drupal\contact\ContactFormAccessControlHandler", | |
* "list_builder" = "Drupal\contact\ContactFormListBuilder", | |
* "form" = { | |
* "add" = "Drupal\contact\ContactFormEditForm", | |
* "edit" = "Drupal\contact\ContactFormEditForm", | |
* "delete" = "Drupal\Core\Entity\EntityDeleteForm" | |
* } | |
* }, | |
* config_prefix = "form", | |
* admin_permission = "administer contact forms", | |
* bundle_of = "contact_message", | |
* entity_keys = { | |
* "id" = "id", | |
* "label" = "label" | |
* }, | |
* links = { | |
* "delete-form" = "/admin/structure/contact/manage/{contact_form}/delete", | |
* "edit-form" = "/admin/structure/contact/manage/{contact_form}", | |
* "collection" = "/admin/structure/contact", | |
* "canonical" = "/contact/{contact_form}", | |
* }, | |
* config_export = { | |
* "id", | |
* "label", | |
* "recipients", | |
* "reply", | |
* "weight", | |
* } | |
* ) | |
*/ | |
class ContactForm extends ConfigEntityBundleBase implements ContactFormInterface { | |
/** | |
* The form ID. | |
* | |
* @var string | |
*/ | |
protected $id; | |
/** | |
* The human-readable label of the category. | |
* | |
* @var string | |
*/ | |
protected $label; | |
/** | |
* List of recipient email addresses. | |
* | |
* @var array | |
*/ | |
protected $recipients = array(); | |
/** | |
* An auto-reply message. | |
* | |
* @var string | |
*/ | |
protected $reply = ''; | |
/** | |
* The weight of the category. | |
* | |
* @var int | |
*/ | |
protected $weight = 0; | |
/** | |
* {@inheritdoc} | |
*/ | |
public function getRecipients() { | |
return $this->recipients; | |
} | |
/** | |
* {@inheritdoc} | |
*/ | |
public function setRecipients($recipients) { | |
$this->recipients = $recipients; | |
return $this; | |
} | |
/** | |
* {@inheritdoc} | |
*/ | |
public function getReply() { | |
return $this->reply; | |
} | |
/** | |
* {@inheritdoc} | |
*/ | |
public function setReply($reply) { | |
$this->reply = $reply; | |
return $this; | |
} | |
/** | |
* {@inheritdoc} | |
*/ | |
public function getWeight() { | |
return $this->weight; | |
} | |
/** | |
* {@inheritdoc} | |
*/ | |
public function setWeight($weight) { | |
$this->weight = $weight; | |
return $this; | |
} | |
} |