function setValue($entity, $value)
    {
        switch ($this->format)
        {
            case 'scalar':
                $this->property->setValue($entity, $value);
                break;

            //Unserialize classes and arrays before putting them back in the entity.
            case 'object':
            case 'array':
                $this->property->setValue($entity, unserialize($value));
                break;

            //Decode Json from DB back into a regular assoc array before putting it into the entity.
            case 'json':
                $this->property->setValue($entity, json_decode($value, true));
                break;

            //Create a date time object out of the db stored date before putting it into the entity.
            case 'date':
                $date = null;
                if ($value) {
                    $date = new \DateTime($value . ' UTC');
                    $date->setTimezone(new \DateTimeZone(date_default_timezone_get()));
                }

                $this->property->setValue($entity, $date);
                break;
        }
    }
function setValue($entity, $value)
    {
        switch ($this->format)
        {
            case 'scalar':
                $this->property->setValue($entity, $value);
                break;

            //Unserialize classes and arrays before putting them back in the entity.
            case 'object':
            case 'array':
                $this->property->setValue($entity, unserialize($value));
                break;

            //Decode Json from DB back into a regular assoc array before putting it into the entity.
            case 'json':
                $this->property->setValue($entity, json_decode($value, true));
                break;

            //Create a date time object out of the db stored date before putting it into the entity.
            case 'date':
                $date = null;
                if ($value) {
                    $date = new \DateTime($value . ' UTC');
                    $date->setTimezone(new \DateTimeZone(date_default_timezone_get()));
                }

                $this->property->setValue($entity, $date);
                break;
        }
    }
function setValue ( $ entity , $ value ) { switch ( $ this -> format ) { case 'scalar' : $ this -> property -> setValue ( $ entity , $ value ) ; break ; //Unserialize classes and arrays before putting them back in the entity. case 'object' : case 'array' : $ this -> property -> setValue ( $ entity , unserialize ( $ value ) ) ; break ; //Decode Json from DB back into a regular assoc array before putting it into the entity. case 'json' : $ this -> property -> setValue ( $ entity , json_decode ( $ value , true ) ) ; break ; //Create a date time object out of the db stored date before putting it into the entity. case 'date' : $ date = null ; if ( $ value ) { $ date = new \ DateTime ( $ value . ' UTC' ) ; $ date -> setTimezone ( new \ DateTimeZone ( date_default_timezone_get ( ) ) ) ; } $ this -> property -> setValue ( $ entity , $ date ) ; break ; } }
Sets this property's value in the given entity.

@param Relation|Node $entity The entity to set the property of.
@param mixed $value The value to set it to.
Sets this property s value in the given entity .