/home/desid573/public_html/eway/pdd/app/Vendor/eway/src/Rapid/Model/Support
NameSizeModeActions
CanGetClassTrait.php2840644editdlrm
CanValidateEnumTrait.php4120644editdlrm
CanValidateInstanceTrait.php5290644editdlrm
HasAttributesTrait.php47860644editdlrm
HasBeagleVerificationTrait.php4210644editdlrm
HasCardDetailTrait.php4090644editdlrm
HasCustomersTrait.php6720644editdlrm
HasCustomerTrait.php4290644editdlrm
HasItemsTrait.php6050644editdlrm
HasOptionsTrait.php4340644editdlrm
HasPaymentTrait.php4360644editdlrm
HasRefundTrait.php3430644editdlrm
HasShippingAddressTrait.php4080644editdlrm
HasTransactionsTrait.php7230644editdlrm
HasTransactionTypeTrait.php5470644editdlrm
HasVerificationTrait.php3840644editdlrm
Edit: /home/desid573/public_html/eway/pdd/app/Vendor/eway/src/Rapid/Model/Support/HasAttributesTrait.php (4786B)
$value) { if ($this->isFillable($key)) { $this->setAttribute($key, $value); } } return $this; } /** * Determine if the given attribute may be mass assigned. * * @param string $key * * @return bool */ public function isFillable($key) { if (in_array($key, $this->fillable)) { return true; } return empty($this->fillable); } /** * Get an attribute from the model. * * @param string $key * * @return mixed */ public function getAttribute($key) { $value = $this->getAttributeFromArray($key); return $value; } /** * Set a given attribute on the model. * * @param string $key * @param mixed $value * * @return mixed */ public function setAttribute($key, $value) { if ($this->hasSetMutator($key)) { $method = 'set'.$this->getStudlyCase($key).'Attribute'; return $this->{$method}($value); } $this->attributes[$key] = $value; return $this; } /** * Determine if a get mutator exists for an attribute. * * @param string $key * * @return bool */ public function hasGetMutator($key) { return method_exists($this, 'get'.$this->getStudlyCase($key).'Attribute'); } /** * Determine if a set mutator exists for an attribute. * * @param string $key * * @return bool */ public function hasSetMutator($key) { return method_exists($this, 'set'.$this->getStudlyCase($key).'Attribute'); } /** * Convert the model's attributes to an array. * * @return array */ public function attributesToArray() { $attributes = $this->attributes; foreach ($attributes as $key => $value) { $attributes[$key] = $this->_toArrayRecursive($value); } return $attributes; } /** * Dynamically retrieve attributes on the model. * * @param string $key * * @return mixed */ public function __get($key) { return $this->getAttribute($key); } /** * Dynamically set attributes on the model. * * @param string $key * @param mixed $value */ public function __set($key, $value) { $this->setAttribute($key, $value); } /** * Determine if an attribute exists on the model. * * @param string $key * * @return bool */ public function __isset($key) { return isset($this->attributes[$key]) || ($this->hasGetMutator($key) && !is_null($this->getAttribute($key))); } /** * Unset an attribute on the model. * * @param string $key */ public function __unset($key) { unset($this->attributes[$key]); } /** * Get an attribute from the $attributes array. * * @param string $key * * @return mixed */ protected function getAttributeFromArray($key) { if (array_key_exists($key, $this->attributes)) { return $this->attributes[$key]; } trigger_error(sprintf("Undefined property '%s' in class '%s'", $key, get_called_class()), E_USER_NOTICE); return null; } /** * @param $str * * @return mixed */ protected function getStudlyCase($str) { $str = ucwords(str_replace(['-', '_'], ' ', $str)); return str_replace(' ', '', $str); } /** * @param $subject * * @return array */ private function _toArrayRecursive($subject) { if (is_array($subject)) { foreach ($subject as $key => $value) { $subject[$key] = $this->_toArrayRecursive($value); } return $subject; } else { return $subject instanceof Arrayable ? $subject->toArray() : $subject; } } }