Adds a task to the collection.

@param string|\Feedback\Store\StoreInterface $store The store to run.
@return $this
180622
public function add($store) {
		if (is_string($store)) {
			$store = new $store();
		}

		$class = get_class($store);
		if (!$store instanceof StoreInterface) {
			throw new InvalidArgumentException(
				"Cannot use '$class' as task, it is not implementing " . StoreInterface::class . '.'
			);
		}

		$this->stores[$class] = $store;

		return $this;
	}
269005
public function addQuestion(QuestionInterface $question)
    {
        if (!$this->hasQuestion($question)) {
            $this->questions->add($question);
        }

        return $this;
    }
1144934
public function setStore( &$store ) {
		if ( ! $this->isValidStore( $store ) ) {
			return;
		}

		$this->store = &$store;

		if ( ! isset( $this->store[ $this->store_key ] ) ) {
			$this->store[ $this->store_key ] = [
				static::CURRENT_KEY => [],
				static::NEXT_KEY => [],
			];
		}

		$this->flashed = $store[ $this->store_key ];
	}
517527
public function addCache(CacheInterface $cache)
    {
        $this->cacheMap[$cache->getName()] = $cache;
        $this->cacheNames[]                = $cache->getName();
    }
115083
public function add(JobInterface $job)
    {
        if (! $job->getName()) {
            throw new JobException('Add a name to the job.');
        }

        $jobs[$job->getName()] = $job;
    }
521589
public function addEntry(LdifEntryInterface ...$entries)
    {
        foreach ($entries as $entry) {
            $this->entries[] = $entry;
        }

        return $this;
    }
1010894
public function preventOverlapping(StoreInterface $store = null)
    {
        $lockStore = $store ?: $this->createDefaultLockStore();
        $this->preventOverlapping = true;
        $this->lockFactory = new Factory($lockStore);

        // Skip the event if it's locked (processing)
        $this->skip(function () {
            $lock = $this->createLockObject();
            $lock->acquire();

            return !$lock->isAcquired();
        });

        // Delete the lock file when the event is completed
        $this->after(function (): void {
            $this->releaseLock();
        });

        return $this;
    }
1324378
public function set(array $data): CollectionInterface
    {
        foreach ($data as $row) {
            $this->add($row);
        }

        return $this;
    }
1242450
public static function makePersistentDataStore($store = null)
    {
        if (is_null($store) || $store === 'session') {
            return new SessionPersistentDataStore();
        }

        if ($store instanceof PersistentDataStoreInterface) {
            return $store;
        }

        throw new InvalidArgumentException('The persistent data store must be set to null, "session" or be an instance of use \Kunnu\Dropbox\Store\PersistentDataStoreInterface');
    }
660965
public function setSessionStorage(SessionInterface $storage)
    {
        $storage->setServer($this);
        $this->sessionStorage = $storage;

        return $this;
    }
1123066
public function run(JobInterface $job)
    {
        parent::run($job);

        if (!($job instanceof MappedJob)) {
            return $this;
        }


        $job->setResult(
            $this->mapper->map(
                $job->getEntityRepository(),
                $job->getMappedClass(),
                $job->getResult()
            )
        );

        // allow chaining
        return $this;
    }
975807
private function processAbandonedCartsProgramEnrolmentAutomation($store)
    {
        $storeId = $store->getId();
        $programId = $this->helper->getScopeConfig()->getValue(
            \Dotdigitalgroup\Email\Helper\Config::XML_PATH_LOSTBASKET_ENROL_TO_PROGRAM_ID,
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE,
            $storeId
        );

        if (empty($programId) || $programId === "0") {
            return;
        }

        $updated = $this->interval->getAbandonedCartProgramEnrolmentWindow($storeId);

        $quoteCollection = $this->getStoreQuotesForGuestsAndCustomers($storeId, $updated);

        foreach ($quoteCollection as $quote) {
            $this->saver->save($quote, $store, $programId);
            $this->cartInsight->send($quote, $storeId);
        }
    }
743400
public function setJob(JobInterface $job)
    {
        $this->job = $job;
        
        $this->getRefs()->setJob($job);
        
        return $this;
    }
1124980
public function addCompiler(CompilerInterface $compiler)
    {
        if (!in_array($compiler, $this->compilers)) {
            $blocks = &$compiler->getBlocksByName($this->name);
            $blocks[] = $this;
            $this->compilers[] = $compiler;
        }

        return $this;
    }
72459
public function setScopeStorage(ScopeInterface $storage)
    {
        $storage->setServer($this);
        $this->scopeStorage = $storage;

        return $this;
    }
91473
protected function mergeStorage(StorageInterface $storage)
    {
        foreach ($storage->all() as $id => $object) {
            $this->stack->getScope('global')->add($object);
        }
    }
299221
public function addListener(ListenerInterface $listener)
    {
        if (!in_array($listener, $this->collection_listeners, true)) {
            $this->collection_listeners[] = $listener;
        }
    }