public function addApiLog(ApiLog $l)
    {
        if ($this->collApiLogs === null) {
            $this->initApiLogs();
            $this->collApiLogsPartial = true;
        }

        if (!in_array($l, $this->collApiLogs->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
            $this->doAddApiLog($l);

            if ($this->apiLogsScheduledForDeletion and $this->apiLogsScheduledForDeletion->contains($l)) {
                $this->apiLogsScheduledForDeletion->remove($this->apiLogsScheduledForDeletion->search($l));
            }
        }

        return $this;
    }