src/DataLoader.php
public function prime($key, $value)
    {
        $this->checkKey($key, __METHOD__);

        $cacheKey = $this->getCacheKeyFromKey($key);

        // Only add the key if it does not already exist.
        if (!$this->promiseCache->has($cacheKey)) {
            // Cache a rejected promise if the value is an Error, in order to match
            // the behavior of load(key).
            $promise = $value instanceof \Exception ? $this->getPromiseAdapter()->createRejected($value) : $this->getPromiseAdapter()->createFulfilled($value);

            $this->promiseCache->set($cacheKey, $promise);
        }

        return $this;
    }
public function prime($key, $value)
    {
        $this->checkKey($key, __METHOD__);

        $cacheKey = $this->getCacheKeyFromKey($key);

        // Only add the key if it does not already exist.
        if (!$this->promiseCache->has($cacheKey)) {
            // Cache a rejected promise if the value is an Error, in order to match
            // the behavior of load(key).
            $promise = $value instanceof \Exception ? $this->getPromiseAdapter()->createRejected($value) : $this->getPromiseAdapter()->createFulfilled($value);

            $this->promiseCache->set($cacheKey, $promise);
        }

        return $this;
    }
public function prime ( $ key , $ value ) { $ this -> checkKey ( $ key , __METHOD__ ) ; $ cacheKey = $ this -> getCacheKeyFromKey ( $ key ) ; // Only add the key if it does not already exist. if ( ! $ this -> promiseCache -> has ( $ cacheKey ) ) { // Cache a rejected promise if the value is an Error, in order to match // the behavior of load(key). $ promise = $ value instanceof \ Exception ? $ this -> getPromiseAdapter ( ) -> createRejected ( $ value ) : $ this -> getPromiseAdapter ( ) -> createFulfilled ( $ value ) ; $ this -> promiseCache -> set ( $ cacheKey , $ promise ) ; } return $ this ; }
{@inheritdoc}
{