WC_Data::set_prop PHP Method

set_prop() protected method

This stores changes in a special array so we can track what needs saving the the DB later.
Since: 2.7.0
protected set_prop ( string $prop, mixed $value )
$prop string Name of prop to set.
$value mixed Value of the prop.
    protected function set_prop($prop, $value)
    {
        if (array_key_exists($prop, $this->data)) {
            if (true === $this->object_read) {
                if ($value !== $this->data[$prop] || array_key_exists($prop, $this->changes)) {
                    $this->changes[$prop] = $value;
                }
            } else {
                $this->data[$prop] = $value;
            }
        }
    }