/* (non-phpdoc)
@see Relationship::set()
491614
public function set($object, $key, $value)
    {
        $object->set($this->local, $value->{$this->foreign});
    }
490166
function set($key, $value) {
        parent::set($key, $value);
        if($this !== $this->client->channels) {
            $this->client->channels->set($key, $value);
        }
        
        return $this;
    }
1147970
public function setProperty($key, $value)
    {
        if(null === $this->properties)
        {
            $this->properties = array();
        }
        $key   = (string) $key;
        $value = (string) $value;

        $this->properties[$key] = $value;

        if((substr($key, 0, 5) == 'tree_') && $this->hasChildren())
        {
            foreach($this->children as $child)
            {
                if(!$child->hasProperty($key))
                {
                    $child->setProperty($key, $value);
                }
            }
        }
    }
590753
public function set($key, $value) {
        if ($key) {
            $this->_data[$key] = $value;
        } else {
            $this->_data = $value;
        }
        $this->_modified = true;
        return $this;
    }
21549
public function set($attribute, $value)
    {
        list($relationArray, $column, $jsonArray) = FieldNameSlicer::split($attribute);
        $column = $jsonArray ? ($column . '->' . join('->', $jsonArray)) : $column;

        if (count($relationArray) === 0) {
            $this->data->setAttribute($column, $value);

            return;
        }

        $relation = join('.', $relationArray);
        $related = $this->data->getRelationValue($relation);
        if ($related && $related instanceof Model) {
            $related->setAttribute($column, $value);
            $this->relations[$relation] = $related;
        }
    }
697536
public function setAttribute($key, $value)
	{
		if ($value instanceof BaseModel || $value instanceof Collection)
			$this->setRelationship($value, $key);
		elseif ( !is_array($value))
			$this->attributes[$key] = $value;
		else
			$this->setRelationship($value, $key);
	}
875316
final public function set($value)
    {
        $isValid = false;

        if ($value === null) {
            $this->clear();
            $isValid = true;
        } elseif (is_object($value)) {
            $isValid = $this->fromObject($value);
        } elseif (is_bool($value)) {
            $isValid = $this->fromBool($value);
        } elseif (is_int($value)) {
            $isValid = $this->fromInt($value);
        } elseif (is_double($value)) {
            $isValid = $this->fromDouble($value);
        } elseif (is_string($value)) {
            $isValid = $this->fromString($value);
        } elseif (is_array($value)) {
            $isValid = $this->fromArray($value);
        } elseif (is_resource($value)) {
            $isValid = $this->fromResource($value);
        }

        if (!$isValid) {
            throw new \UnexpectedValueException(sprintf(
                'The value of type "%s" could not be converted to "%s".', gettype($value), get_called_class()
            ));
        }
        return $this;
    }
679499
public function set($key, $value)
    {
        $this->assertElementIsOfType($value);

        $this->collection->set($key, $value);
    }
1144550
public function setMeta(string $key, $value)
    {
        if ($this->hasMeta($key)) {
            $meta = $this->getMetaRecord($key);
            $meta->setAttribute('value', $value);
            $meta->save();
        } else {
            $meta = $this->makeMeta($key, $value);
            $this->meta()->save($meta);
        }

        // Update cached relationship, if necessary.
        if ($this->relationLoaded('meta')) {
            $this->meta[$key] = $meta;
        }
    }
1239577
public function set($key, $value)
    {
        parent::set($key, $value);

        if ($key == "ACCESS_TOKEN") { 
            $user = $this->getUserId($value);
            parent::set('USER_ID', $user['id']);
        }
        
        if (parent::get('CLIENT_ID') != "" && parent::get('CLIENT_SECRET') != "" && empty(parent::get('ACCESS_TOKEN'))) {
            
            $response = $this->getToken();

            if (isset($response['access_token'])) {
                parent::set('ACCESS_TOKEN', $response['access_token']);
            

                $user = $this->getUserId($response['access_token']);

                if (isset($user['id'])) {
                    parent::set('USER_ID', $user['id']);
                }

            }
            
        }
    }
204344
public function set($value)
    {
        return (
            ($this->value = $this->clean($value, true, false)) &&
            ($this->rawValue = $value)
        );
    }
912697
public function setRelationship($value, $key = '')
	{
		if (is_array($value)) {

			$class = __NAMESPACE__ . '\\' . str_singular($key);

			if (class_exists($class)) {

				// Check to see if the key value is plural or singular
				// if it is plural then we create a collection
				// otherwise we instantiate the class and add a single item to the relationship
				if (str_singular($key) == $key) {
					$this->addRelationship(new $class($value));
				}
				else {
					$collection = $class::newCollection($value);
					$this->addRelationship($collection);
				}
			}
		}
		elseif ($value instanceof Collection) {
			$this->addRelationship($value);
		}
		elseif ($value instanceof BaseModel) {
			$this->addRelationship($value);
		}
	}
458966
public function xor(Set $set): SetInterface
    {
        $set = new \DS\Set($set);
        $items = $this->items->xor($set);

        return $this->duplicate($items);
    }
68377
public function setAttribute($key, $value)
    {
        if ($this->hasSetMutator($key)) {
            $method = 'set'.Str::studly($key).'Attribute';

            return $this->{$method}($value);
        }

        $this->model->attributes[$key] = $value;
    }
823136
public function set($key, $value)
    {
        // Check if the specified property is defined.
        if (property_exists($this, $key) && $key != 'data') {
            $this->{$key} = trim($value);

            return $this;
        } elseif (property_exists($this, $key) && $key == 'data') {
            foreach ($value as $v_key => $v_value) {
                $this->{$key}[$v_key] = trim($v_value);
            }

            return $this;
        } else {
            return false;
        }
    }
971613
protected function setRelationship($key, $value)
    {
        if (true === $this->isHasOne($key)) {
            return $this->setHasOne($key, $value);
        }
        if (true === $this->isHasMany($key)) {
            throw new \RuntimeException('You cannot set a hasMany relationship directly. Please access using push(), clear(), and/or remove()');
        }
        return $this;
    }
992812
function set($key, $value) {
        parent::set($key, $value);
        if($this !== $this->client->users) {
            $this->client->users->set($key, $value);
        }
        
        return $this;
    }