Add the given amount of weekdays to the current datetime object. This is necessary as the modification
of the weekday in the internal PHP DateTime removes the time (sets it to 00:00:00).

@param int $value
@return $this
504651
public function addWeekdays($value)
    {
        $direction = $value > 0 ? 1 : -1;
        $value = abs($value);

        while ($value > 0) {
            $this->addDays($direction);

            while ($this->isWeekend()) {
                $this->addDays($direction);
            }

            $value--;
        }

        return $this;
    }
906231
public function set($value = null)
	{
		$ts = sfDateTimeToolkit::getTS($value);
		
		$this->ts = $ts;
		if ($this->init === null)
		{
			$this->init = $ts;
		}
		
		return $this;
	}
1143812
protected function Sub($value)
	{
		switch ( $value->GetValueCode() )
		{
			case DateTimeProxyFactory::Code:
				return new DayTimeDurationProxy( DateTimeValue::Sub( $this->_value, /* DateTimeValue */ $value->getValue() ) );

			case YearMonthDurationProxyFactory::Code:
				/**
				 * @var DayTimeDurationProxy $value
				 */
				// Clone the DateValue contained in the proxy or the original is changed
				$clone = DateTimeValue::fromDate( $this->_value->S, clone $this->_value->Value, ! $this->_value->IsLocal );
				$value->getValue()->Value->invert = ! $value->getValue()->Value->invert;
				return new DateTimeProxy( DateTimeValue::AddYearMonthDuration( $clone, $value->getValue() ) );
				// return new DateTimeProxy( DateTimeValue::Add( $this->_value, - /* YearMonthDurationValue */ $value->getValue() ) );

			case DayTimeDurationProxyFactory::Code:
				/**
				 * @var DayTimeDurationProxy $value
				 */
				// Clone the DateValue contained in the proxy or the original is changed
				$clone = DateTimeValue::fromDate( $this->_value->S, clone $this->_value->Value, ! $this->_value->IsLocal );
				$value->getValue()->Value->invert = ! $value->getValue()->Value->invert;
				return new DateTimeProxy( DateTimeValue::AddDayTimeDuration( $clone, $value->getValue() ) );
				// return new DateTimeProxy( DateTimeValue::Add( $this->_value, - /* DayTimeDurationValue */ $value->getValue() ) );

			default:
				throw XPath2Exception::withErrorCodeAndParams("XPTY0004", Resources::BinaryOperatorNotDefined,
					array(
						"op:sub",
						SequenceType::WithTypeCodeAndCardinality( SequenceType::GetXmlTypeCodeFromObject( $this->_value), XmlTypeCardinality::One ),
						SequenceType::WithTypeCodeAndCardinality( SequenceType::GetXmlTypeCodeFromObject( $value->getValue() ), XmlTypeCardinality::One )
					)
				);
		}
	}
901752
public function setValue($value)
    {
        if ($value instanceof \DateTime) {
            $this->value = $value->getTimestamp();
        } else {
            $this->value = $value;
        }

        return $this;
    }
1307170
public function formatDateTime($value): \DateTime
    {
        if ($value instanceof \DateTime) {
            return $value;
        }

        if (is_numeric($value)) {
            $date = new \DateTime();
            $date->setTimestamp((int) $value);

            return $date;
        } elseif (null === $value) {
            return new \DateTime();
        }

        return new \DateTime($value);
    }
541884
public function day($value = null)
    {
        if ($value !== null) {
            if ($value > 31 || $value < 1) {
                $this->day = 1;
            } else {
                $this->day = $value;
            }
        }
        return $this->day;
    }
630242
public function withOneTimePayment($value)
    {
        $this->oneTimePayment = $value;
        $this->transactionModifier = TransactionModifier::RECURRING;
        return $this;
    }
641814
public function addMonthsNoOverflow($value)
    {
        $date = $this->addMonths($value);

        if ($date->getDay() !== $this->getDay()) {
            $date = $date->day(1)->subMonth();
            $date = $date->day($date->getDaysInMonth());
        }

        return $date;
    }
9145
public function setCurrent($value)
    {
        if (!StaticValidator::isValid('number', $value)) {
            return $this;
        }

        $this->_current = StaticFilter::filter('number',$value);
        $this->_offset = $this->_rowsPerPage * ($this->_current - 1);
        return $this;
    }
340187
public function setValue($value)
	{
		if(is_numeric($value))
			$value = (int) $value;
		if(is_string($value))
			$value = strtotime($value);
		$value = date('Y/m/d', $value);
		$value = parent::setValue($value);
		return $value;
	}
258133
public function setPaymentMethod($value)
    {
        if (!$this->_isNumericArray($value)) {
            $value = array ($value);
        }
        $this->_fields['PaymentMethod']['FieldValue'] = $value;
        return $this;
    }
165930
public function val($value = null)
    {
        if (!$this->isNull($value)) {
            $this->value = $value;

            return $this;
        }

        return $this->getDateObject()->format($this->format);
    }
29797
public function defaultValue($value): AbstractColumn
    {
        //Forcing driver specific values
        if ($value === self::DATETIME_NOW) {
            $value = static::DATETIME_NOW;
        }

        $this->defaultValue = $value;

        return $this;
    }
1229678
public function setDateCreated($value) : Job
    {
        $this->validateDate('DateCreated', $value);

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

        return $this;
    }
606158
public void setWeeklyDay(Day day, boolean value)
   {
      if (value)
      {
         m_days.add(day);
      }
      else
      {
         m_days.remove(day);
      }
   }
665414
public function mul($value)
    {
        $this->requiresCurrentField();
        $this->newObj['$mul'][$this->currentField] = $value;
        return $this;
    }
32433
public function setDiscount($value)
    {
        $this->data->amount->subtotals->discount = (float) $value;

        return $this;
    }