diff --git a/src/Model/AbstractModel.php b/src/Model/AbstractModel.php index 41a1838..9c7ce4f 100644 --- a/src/Model/AbstractModel.php +++ b/src/Model/AbstractModel.php @@ -120,7 +120,7 @@ public function setApiCredentials(ApiCredentials $credentials = null) */ public function __set($key, $value) { - if (!$value) { + if ($value) { $this->data[$key] = $value; } @@ -191,7 +191,7 @@ abstract public function save(); * * @return array */ - public static function getConfigurableFields() + public function getConfigurableFields() { return static::$configurableFields; } diff --git a/src/Model/NewsletterAttribute.php b/src/Model/NewsletterAttribute.php index be299a2..8b2a033 100644 --- a/src/Model/NewsletterAttribute.php +++ b/src/Model/NewsletterAttribute.php @@ -24,7 +24,8 @@ * @method NewsletterAttribute setId($id) * @method NewsletterAttribute setName($name) * @method NewsletterAttribute setType($type) One of ['number', 'date', 'boolean', 'text'] - * @method NewsletterAttribute setSubType($subType) + * @method NewsletterAttribute setSubType($subType) One of the ['text', 'email', 'color', 'url', 'tel', 'date', + * 'datetime', 'time', 'integer', 'float'] * @method string getId() * @method string getCompanyId() * @method string getName() diff --git a/src/Model/NewsletterRecipient.php b/src/Model/NewsletterRecipient.php index da40e68..4bac5a3 100644 --- a/src/Model/NewsletterRecipient.php +++ b/src/Model/NewsletterRecipient.php @@ -63,6 +63,16 @@ class NewsletterRecipient extends AbstractModel implements ModelDeletableInterfa 'is_blacklisted', ]; + /** + * Get all configurable fields + * + * @return array + */ + public function getConfigurableFields() + { + return array_keys($this->getData()); + } + /** @noinspection MoreThanThreeArgumentsInspection * * Find recipients by a selected list and group @@ -77,6 +87,7 @@ class NewsletterRecipient extends AbstractModel implements ModelDeletableInterfa * @throws \InvalidArgumentException * @throws \RuntimeException * @throws \LogicException + * @throws \League\OAuth2\Client\Provider\Exception\IdentityProviderException */ public static function findByListAndGroup( $lid, @@ -109,6 +120,7 @@ public static function findByListAndGroup( * @throws \InvalidArgumentException * @throws \RuntimeException * @throws \LogicException + * @throws \League\OAuth2\Client\Provider\Exception\IdentityProviderException */ public static function findByList($lid, GetParameters $getParams = null, ApiCredentials $credentials = null) { @@ -132,8 +144,10 @@ public static function findByList($lid, GetParameters $getParams = null, ApiCred * * @return void * + * @throws \InvalidArgumentException * @throws \RuntimeException * @throws \LogicException + * @throws \League\OAuth2\Client\Provider\Exception\IdentityProviderException */ public function addToGroup($gid) { @@ -158,8 +172,10 @@ public function addToGroup($gid) * * @return void * + * @throws \InvalidArgumentException * @throws \RuntimeException * @throws \LogicException + * @throws \League\OAuth2\Client\Provider\Exception\IdentityProviderException */ public function removeFromGroup($gid) { @@ -182,8 +198,10 @@ public function removeFromGroup($gid) * * @return self * + * @throws \InvalidArgumentException * @throws \RuntimeException * @throws \LogicException + * @throws \League\OAuth2\Client\Provider\Exception\IdentityProviderException */ public function save() { @@ -210,8 +228,10 @@ public function save() * * @return void * + * @throws \InvalidArgumentException * @throws \RuntimeException * @throws \LogicException + * @throws \League\OAuth2\Client\Provider\Exception\IdentityProviderException */ public function delete() { @@ -249,8 +269,10 @@ public function delete() * * @return self * + * @throws \InvalidArgumentException * @throws \RuntimeException * @throws \LogicException + * @throws \League\OAuth2\Client\Provider\Exception\IdentityProviderException */ private function update() {