Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function __construct(array $values, $entity_type, $bundle = FALSE, $translations = array()) {
- parent::__construct($values, $entity_type, $bundle = FALSE, $translations = array());
- $values += $this->generateCharacteristics();
- foreach ($values as $key => $value)
- {
- $method = 'set'.ucfirst($key);
- // For two-words attributes
- if( strstr($method, '_') ) {
- $method = explode('_', $method);
- $method[1] = ucfirst($method[1]);
- $method = implode('', $method);
- }
- if (method_exists($this, $method))
- {
- $this->$method($value);
- }
- }
- }
Add Comment
Please, Sign In to add comment