for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Analogue\ORM\System\Wrappers;
/**
* Simple Wrapper for Mappable objects
*/
class EntityWrapper extends Wrapper
{
* Method used by the mapper to set the object
* attribute raw values (hydration)
*
* @param array $attributes
* @return void
public function setEntityAttributes(array $attributes)
$this->entity->setEntityAttributes($attributes);
}
* Method used by the mapper to get the
* raw object's values.
* @return array
public function getEntityAttributes()
return $this->entity->getEntityAttributes();
* Method used by the mapper to set raw
* key-value pair
* @param string $key
* @param string $value
public function setEntityAttribute($key, $value)
$attributes = $this->entity->getEntityAttributes();
$attributes[$key] = $value;
* Method used by the mapper to get single
* @return mixed|null
public function getEntityAttribute($key)
if ($this->hasAttribute($key)) {
return $attributes[$key];
} else {
return null;
* Test if a given attribute exists
* @return boolean
public function hasAttribute($key)
if (array_key_exists($key, $attributes)) {
return true;
return false;