Transform contact.
@param $value
@param $index
423691
public function transformContact ($value, $index)
	{
		if (! ($this[$index] instanceof Image)) {
			$contact = Image::fromMixed ($value);
			$this[$index] = $contact;
		}
	}
736095
public function lset($key, $index, $value)
    {
        try {
            return $this->redis->lset($key, $index, $value);
        } catch (\RedisException $e) {
            die("Error!: " . $e->getMessage() . "<br/>");
        }
    }
681257
public function insert($index, $value)
    {
        $count = $this->count();

        if ($index == $count) {
            return $this->append($value);
        }

        if ($index < 0) {
            throw new OutOfRangeException("Index have to be greater than 0 not $index");
        }

        if ($index > $count) {
            throw new OutOfRangeException("Index $index overflows greatest index $count");
        }

        array_splice($this->source, $index, 0, $value);

        return $this;
    }
1296848
public void replace(int index, Object value) {
    values.set(index, value);
    this.path = null; // path is no longer valid if values are replaced
  }
705175
public function offsetAppend($index, $value)
    {
        $items = [];
        if ($this->offsetExists($index)) {
            $items = $this->offsetGet($index);
            if (!is_array($items)) {
                $itemsType = gettype($items);
                throw new \Exception("Offset '$index' is '$itemsType' and must be array to append.");
            }
        }
        $items[] = $value;
        $this->offsetSet($index, $items);
    }
307509
public function set($index, $value)
    {
        if($index >= $this->count())
            throw new OutOfRangeException('Index out of range');

        $this->_collection[$index] = $value;
    }
646104
public function setIsBlocked(int $value) : Contact
    {

        if ($this->data['is_blocked'] !== $value) {
            $this->data['is_blocked'] = $value;
            $this->setModified('is_blocked');
        }

        return $this;
    }
455398
public static function forIndex(string $index, string $value, ?\Throwable $previous = null): self
    {
        return new self("The node could not be found by ({$index}:{$value}).", $previous);
    }
436787
public function offsetSet($offset, $value)
    {
        if (is_null($offset)) {
            $this->_args[count($this->_args)] = $value;
        } else {
            if (is_int($offset)) {
                $this->_args[$offset] = $value;
            } else {
                throw new \Exception('Cannot set offset \''.$offset.'\' of IndexedArray.');
            }
        }
    }
405198
public function setTitle(?string $value) : Contact
    {

        if ($this->data['title'] !== $value) {
            $this->data['title'] = $value;
            $this->setModified('title');
        }

        return $this;
    }
440175
public function removeDealerContactInfoVersion($value)
    {
        $targetArray = array();
        foreach ($this->getDealerContactInfoVersions() as $element) {
            if ($element != $value) {
                $targetArray []= $element;
            }
        }
        $this->setDealerContactInfoVersions($targetArray);

        return $this;
    }
1057496
public function set($key, $value)
    {
        if (!$value instanceof Contact) {
            throw new InvalidArgumentException(
                sprintf(
                    '%s only accepts instances of %s. Tried to to set key %s.',
                    __FUNCTION__, Contact::class, $key
                )
            );
        }

        parent::set($key, $value);
    }
401834
public function with($index, $value)
    {
        $res = clone $this;

        $res->fragments = $this->insertInList($res->fragments, $index, $value);

        return $this;
    }
1098368
public function add($index, $value): Utility
    {
        if (is_null($this->get($index))) {
            return $this->set($index, $value);
        }

        return $this;
    }
643152
final public function offsetSet($index, $value): void
    {
        if (is_null($index)) {
            throw CannotAlterCollection::byAddingTo($this);
        }
        throw CannotAlterCollection::byOverWriting($this, $index);
    }
923755
public function transform($value)
    {
        if (null === $value) {
            return null;
        }

        if (!$value instanceof APIRoleAssignment) {
            throw new TransformationFailedException('Expected a ' . APIRoleAssignment::class . ' object.');
        }

        return $value->id;
    }
1142591
public function setPhone(?string $value) : Contact
    {

        if ($this->data['phone'] !== $value) {
            $this->data['phone'] = $value;
            $this->setModified('phone');
        }

        return $this;
    }