Adds a holiday to the list. If there already is a holiday with the same name and date, then the holiday will
not be added a second time, but its types will be added to the existing one.

@param Holiday $holiday
176208
public function add(Holiday $holiday)
    {
        if (-1 !== $index = $this->getIndexByNameAndDate($holiday->getName(), $holiday->getDate())) {
            $this->holidayList[$index] = new Holiday($holiday->getName(), $holiday->getDate(), $holiday->getType() | $this->holidayList[$index]->getType());
        } else {
            $this->holidayList[] = $holiday;
        }
    }
1356707
public function add_days($days)
    {
        
        if ($days < 0) {
            return $this->sub_days($days * -1);
        }
        
        if ($this->flag_jours_ouvres == true) {
            for ($d = 0; $d < $days;) {
                $this->time += self::$TIME2SEC['d'];
                $this->set_timestamp($this->time);
                
                if ($this->est_jours_ouvres()) {
                    $d++;
                }
            }
        }
        else {
            $this->time += $days * self::$TIME2SEC['d'];
            $this->set_timestamp($this->time);
        }
        
        return $this;
    }
1269041
public function setExpiresOn($date)
    {
        $date = AnDomainAttributeDate::getInstance()->setDate($date);
        $this->set('expiresOn', $date);
    }
37017
public function addUse(string $use) : bool
    {
        $retval = false;

        if (!array_search($use, $this->interface_list)) {
            $this->use_list[] = $use;
            $retval = true;
        }

        return $retval;
    }
454965
public function add($type)
    {
        $this->value[] = $type;
        $this->value = array_unique($this->value);
    }
1315072
public function add($duration)
    {
        $d1 = $this->refDate;
        $d2 = clone $d1;

        if ($duration instanceof QtiDuration) {
            $toAdd = $duration;
        } elseif ($duration instanceof DateInterval) {
            $toAdd = self::createFromDateInterval($duration);
        } else {
            return;
        }

        $d2->add(new DateInterval($this->__toString()));
        $d2->add(new DateInterval($toAdd->__toString()));

        $interval = $d2->diff($d1);
        $this->interval = $interval;
    }
1042755
public function add($item)
    {
        if (is_numeric($item)) {
            $item = DataObject::get_by_id($this->dataClass, $item);
        } elseif (!($item instanceof $this->dataClass)) {
            user_error("HasManyList::add() expecting a $this->dataClass object, or ID value", E_USER_ERROR);
        }

        $foreignID = $this->getForeignID();

        // Validate foreignID
        if (!$foreignID) {
            user_error("HasManyList::add() can't be called until a foreign ID is set", E_USER_WARNING);
            return;
        }
        if (is_array($foreignID)) {
            user_error("HasManyList::add() can't be called on a list linked to mulitple foreign IDs", E_USER_WARNING);
            return;
        }

        $foreignKey = $this->foreignKey;
        $item->$foreignKey = $foreignID;

        $item->write();
    }
42887
public function add($data)
    {
        $ea = (array) $data;
        foreach ($ea as $key => $value) {
            if (is_array($value)) {
                foreach ($value as $k => $v) {
                    if (is_null($v)) {
                        unset($value[$k]);
                    }
                }
                $value = array_values($value);
                $ea[$key] = $value;
            }
        }

        $this->_errors = $ea;
    }
460290
public static function addDays($date, $days) {
        if (Validator::isDateTime($date) === false) throw new InvalidArgumentException('Invalid argument $date: '.$date);
        if (!is_int($days))                         throw new IllegalTypeException('Illegal type of parameter $days: '.gettype($days));

        $parts = explode('-', $date);
        $year  = (int) $parts[0];
        $month = (int) $parts[1];
        $day   = (int) $parts[2];

        return date('Y-m-d', mktime(0, 0, 0, $month, $day+$days, $year));
    }
235029
function AddDay(Day $day)
    {
        foreach ($this->days as $currentDay)
        {
            if ($currentDay->DayOfWeek() == $day->DayOfWeek())
                return;
        }
        $this->days[] = $day;
    }
559269
public function persist($entity)
    {
        if ($this->evm->hasListeners(Events::prePersist)) {
            $this->evm->dispatchEvent(Events::prePersist, new Event\LifecycleEventArgs($entity, $this->sm));
        }

        $oid = spl_object_hash($entity);
        $this->scheduledForPersist[$oid] = $entity;

        if ($this->evm->hasListeners(Events::postPersist)) {
            $this->evm->dispatchEvent(Events::postPersist, new Event\LifecycleEventArgs($entity, $this->sm));
        }
    }
523428
public function addTranslated(string $locale)
    {
        if ($this->isDefaultLocale($locale)) {
            $this->translated = [$locale];
        } else {
            $translated = $this->getTranslated();
            $translated[] = $locale;
            $this->translated = array_unique($translated);
        }
    }
82324
public function updateList(&$list){
		if($this->modelIsMultiSitesAware()){
			$site = $this->getActiveSite();
			if ($site) {
				$list = $list->filter('SiteID', $site->ID);
			}
		}
	}
241927
private Date addDays(final Date date, final int days) {
        final Calendar cal = Calendar.getInstance();
        cal.setTime(date);
        cal.add(Calendar.DATE, days); //minus number would decrement the days
        return cal.getTime();
    }
155825
public function add($object, $value)
    {
        $newValue = $object->{$this->local};

        if($newValue instanceof PropertyReference)
            $value->saveAfter($object);

        $value->set($this->foreign, $newValue);
    }
335160
public function add($key, $value) {
		$this->validateValue($value);
		if (!isset($this->variables[$key])) {
			$this->variables[$key] = [];
		}

		if (!is_array($this->variables[$key])) {
			$this->variables[$key] = [$this->variables[$key]];
		}

		$this->variables[$key][] = $value;
	}
270104
function collectHolidays() {
      if (typeof self.year.holidays[self.m] !== 'undefined' && typeof self.year.holidays[self.m] !== 'undefined') {
        self.year.holidays[self.m].forEach(function(holiday) {
          if (holidays.length < count && holiday.day >= self.d) {
            holidays.push(holiday);
          }
        });
      }
    }