Set the method's description

@param string $description

@return self
@throws InvalidArgumentException
336660
public function setDescription($description = null) {

        if ( empty($description) ) $this->description = null;

        else if ( !is_string($description) ) throw new InvalidArgumentException("Invalid RpcMethod description");

        else $this->description = $description;

        return $this;

    }
1144487
protected function setDescription()
    {
        if (!isset($this->job)) {
            throw new \InvalidArgumentException('cannot create a viewModel for Templates without a $job');
        }

        if (empty($this->job->getTemplateValues()->getDescription()) && is_object($this->job->getOrganization())) {
            $this->job->getTemplateValues()->setDescription($this->job->getOrganization()->getDescription());
        }
        $description = $this->job->getTemplateValues()->getDescription();

        $this->container['description'] = isset($description)?$description:'';
        return $this;
    }
388701
public function setMethod($method)
    {
        // Allow null, otherwise expect an array or a string
        if (null !== $method && !is_array($method) && !is_string($method)) {
            throw new InvalidArgumentException('Expected an array or string. Got a '. gettype($method));
        }

        $this->method = $method;

        return $this;
    }
892768
public function setDescription($description)
    {
        $tag = ($this->version == Eresus_Feed_Writer::ATOM) ? 'summary' : 'description';
        $this->addElement($tag, $description);
    }
810684
public function setDescription(string $description): Poll
    {
        $description = trim($description);
        $this->description = substr($description, 0, min(static::MAX_LENGTH_DESCRIPTION, strlen($description)));

        return $this;
    }
1234356
public function editDescription(Description $description)
    {
        $this->guardNotDeleted();

        if ($description !== $this->description) {
            $this->apply(new DescriptionEdited($this->id, $description));
        }
    }
461472
protected function setTitle($title)
    {
        if (0 === strlen(trim($title))) {
            throw new \InvalidArgumentException('Provided title cannot be empty');
        }

        $this->title = (string) $title;
    }
578781
public function setMethod($method) {
        if (!is_string($method))                 throw new IllegalTypeException('Illegal type of parameter $method: '.gettype($method));
        if ($method!=='GET' && $method!=='POST') throw new InvalidArgumentException('Invalid argument $method: '.$method);

        $this->method = $method;
        return $this;
    }
1168950
public function setVideoDescription($description)
    {
        $this->ensureMediaGroupIsNotNull();
        $this->getMediaGroup()->setDescription(
            new Zend_Gdata_Media_Extension_MediaDescription($description));
        return $this;
    }
1282263
public function setLongDescription($description)
    {
        $description = trim($description);
        if ($description === '') {
            $this->longDescription = null;
        } else {
            $this->longDescription = $description;
        }

        return $this;
    }
445795
public function setSubscriptionDescription($description)
    {
        if (strlen($description) > 100) {
            throw new InvalidArgumentException("Subscription description cannot be longer than 100 characters");
        }
        if (preg_match('/[^a-zA-Z0-9_ -]/', $description)) {
            throw new InvalidArgumentException("Subscription description cannot contain special characters");
        }
        $this->parameters['sub_com'] = $description;
    }
994520
public function setDescription($description)
    {
        if (!is_string($description))
        {
            throw Eresus_Exception_InvalidArgumentType::factory(__METHOD__, 1, 'string', $description);
        }
        $this->description = $description;
    }
997107
public function setMode($mode)
    {
        if ($mode === null) {
            $this->mode = $mode;
            return $this;
        }

        if (!is_string($mode)) {
            throw new InvalidArgumentException(
                'Order Mode must be a string.'
            );
        }

        $mode  = strtolower($mode);
        $valid = $this->validModes();
        if (!in_array($mode, $valid)) {
            throw new InvalidArgumentException(sprintf(
                'Invalid Order Mode. Must be one of "%s"',
                implode('", "', $valid)
            ));
        }

        if (in_array($mode, [ self::MODE_ASC, self::MODE_DESC ])) {
            $this->setDirection($mode);
        }

        $this->mode = $mode;
        return $this;
    }
828731
public function setProductionDescriptions($descriptions)
    {
        foreach ($descriptions as $description) {
            $description->setVariety($this);
        }
        $this->production_descriptions = $descriptions;

        return $this;
    }
1338788
public function setValue($value) {
		if(!in_array($value, self::VALID_VALUES)) {
			throw new InvalidArgumentException('Value is not valid.');
		}

		$this->value = $value;

		return $this;
	}
804327
public function setCultureDescriptions($descriptions)
    {
        foreach ($descriptions as $description) {
            $description->setVariety($this);
        }
        $this->culture_descriptions = $descriptions;

        return $this;
    }
518279
public function setFieldDescription($field, $description)
    {
        $existing = $this->fields->find('Name', $field);
        if (!$existing) {
            throw new InvalidArgumentException(
                sprintf(
                    'Cannot set description of %s. It has not been added to %s.',
                    $field,
                    $this->getDataObjectClass()
                )
            );
        }

        $this->fields->replace(
            $existing,
            ArrayData::create(
                [
                    'Name' => $field,
                    'Description' => $description
                ]
            )
        );

        return $this;
    }