@param \ArrayAccess $keyvalue

@return bool
514323
public function check(\ArrayAccess $keyvalue)
    {
        foreach ($this as $key => $value) {
            if (!($keyvalue->offsetExists($key) && ($keyvalue->offsetGet($key) === $value))) {
                return false;
            }
        }

        return true;
    }
182669
public function _delete(...$keyValues) {
		$instance = DAO::getOne ( $this->model, $keyValues, false );
		$this->operate_ ( $instance, function ($instance) {
			return DAO::remove ( $instance );
		}, "deleted", "Unable to delete the instance", $keyValues );
	}
286316
public function validateAccessToken($accessToken = null)
	{
		try
		{
			$this->getOpenID($accessToken);
			return true;
		}
		catch(ApiException $e)
		{
			return false;
		}
	}
1029759
private function setSpecificAttributeKeyWithGivenId(\SimpleXMLElement $xml, $keyValue) {
        // Specific Attribute: change the key with the given id
        if ($xml->attributes()->id) {
            return (string) $xml->attributes()->id;
        }
        return $keyValue;
    }
1115009
public function is($enumValue): bool
    {
        if (!static::hasValue($enumValue)) {
            throw new InvalidEnumMemberException($enumValue, $this);
        }

        return $this->value === $enumValue;
    }
473111
protected function validateHeaderValue($headerValue) : void
	{
		if (\is_string($headerValue))
		{
			$headerValue = [$headerValue];
		}

		if (! \is_array($headerValue) || [] === $headerValue)
		{
			throw new \InvalidArgumentException('Header value must be a string or not an empty array');
		}

		foreach ($headerValue as $oneOf)
		{
			if (! \is_string($oneOf))
			{
				throw new \InvalidArgumentException('Header value must be a string or an array containing only strings');
			}
			else if (! \preg_match(HeaderInterface::RFC7230_FIELD_VALUE, $oneOf))
			{
				throw new \InvalidArgumentException(\sprintf('The given header value "%s" is not valid', $oneOf));
			}
		}
	}
472466
public function has($key)
    {
        $key = $this->parseKey($key);

        $string = $key->shift();
        $key->next();

        if ($key->count() === 0) {
            return array_key_exists($string, $this->data);
        }

        if (! array_key_exists($string, $this->data)) {
            return false;
        }

        $value = $this->getValue($string);

        // #TODO Handle other objects and arrays
        if (! $value instanceof Accessable) {
            //throw new AccessException('The existance for the key "' . $key->raw . '" could\'nt be checked.');
            return false;
        }

        return $value->has($key);
    }
638658
public function remove($table, $pkField, $pkValue)
	{
		// Make sure we have an id (i.e. don't delete everything in the table!)
		if (is_null($pkValue) || empty($pkValue))
		{
			return false;
		}

		// Add delete statement
		$this->delete($table)
		     ->whereEquals($pkField, $pkValue);

		// Return result of the query
		return $this->execute();
	}
606402
public static function hasFlashKeyAndValue(string $key, $value): bool
    {
        return \array_key_exists($key, static::$flashData) && static::$flashData[$key] === $value;
    }
316477
public function insert(array $rowValue)
    {
        $insertData = [];
        foreach ($rowValue as $key => $row) {
            $insertKey = "`{$key}`";
            $insertData[$insertKey] = $row;
        }
        return $this->connection->insert($this->getFrom(), $insertData);
    }
35738
public function sets(array $keyArray, $timeout) {
		if (!is_array($keyArray)) {
			throw new Exception('Call  ' . __FUNCTION__ . ' method  parameter  Error !');
		}
		$retRes = $this->driver->mset($keyArray);
		if ($timeout <= 0) {
			return $retRes;
		}
		foreach ($keyArray as $key => $value) {
			$this->driver->expire($key, $timeout);
		}
		return true;
	}
1229685
final public function when($key, $defaultValue = false)
    {
        $data = $this->data($key, false);
        return !empty($data) ? $data : $defaultValue;
    }
517129
function setAttribute( $attributeName, $attributeValue )
    {
        if ( in_array( $attributeName,
                       array( 'alternative_text',
                              'original_filename' ) ) )
        {
            $aliasList = $this->aliasList();
            foreach ( array_keys( $aliasList ) as $aliasName )
            {
                $this->setAliasAttribute( $aliasName, $attributeName, $attributeValue );
            }
            if ( $attributeName == 'alternative_text' )
            {
                $text = $this->displayText( $attributeValue );
                foreach ( array_keys( $aliasList ) as $aliasName )
                {
                    $this->setAliasAttribute( $aliasName, 'text', $text );
                }
            }
            $this->recreateDOMTree();
            $this->setStorageRequired();
            return true;
        }
        return false;
    }
892711
public function deactivate($doiValue)
    {

        // validate client
        if (!$this->isClientAuthenticated()) {
            $this->setResponse('responsecode', 'MT009');
            return false;
        }

        //get the doi info
        $doi = $this->doiRepo->getByID($doiValue);
        $this->setResponse('doi', $doiValue);

        if ($doi === null) {
            $this->setResponse('responsecode', 'MT011');
            return true;
        }

        // check if this client owns this doi
        if (!$this->isDoiAuthenticatedClients($doiValue, $doi->client_id)) {
            $this->setResponse('responsecode', 'MT008');
            $this->setResponse('verbosemessage',$doiValue." is not owned by ".$this->getAuthenticatedClient()->client_name);
            return false;
        }

        //check if the doi is inactive
        if ($doi->status != 'ACTIVE') {
            $this->setResponse('responsecode', 'MT010');
            $this->setResponse('verbosemessage',
                'DOI ' . $doiValue . " not set to ACTIVE so cannot deactivate it");
            return false;
        }

        $result = $this->dataciteClient->deActivate($doiValue);

        if ($result === true) {
            $this->setResponse('responsecode', 'MT003');
            //update the database DOIRepository
            $this->doiRepo->doiUpdate($doi, array('status'=>'INACTIVE'));
        } else {
            $this->setResponse('responsecode', 'MT010');
        }

        return $result;

    }
1272969
public function clear($sFilterValue)
    {
        if (empty($sFilterValue)) {
            return;
        }

        $this->sValue = $sFilterValue;

        $this->clearIDList();

        if (array_key_exists($this->getCacheKey(), $this->arCachedList)) {
            unset($this->arCachedList[$this->getCacheKey()]);
        }
    }
670438
public static function hasKeyFormat($value, AbstractValidator $keyValidator)
    {
        if ($value instanceof \ArrayObject) {
            $value = $value->getArrayCopy();
        }

        if ($value instanceof \SplFixedArray) {
            $value = $value->toArray();
        }

        $arrayKeys = \array_keys($value);
        $isValid   = true;

        foreach ($arrayKeys as $key) {
            $isValid = $isValid && $keyValidator->validate($key);
        }

        return $isValid;
    }
774568
public function getStatus($doiValue)
    {
        // validate client
        if (!$this->isClientAuthenticated()) {
            $this->setResponse('responsecode', 'MT009');
            return false;
        }

        //get the doi info
        $doi = $this->doiRepo->getByID($doiValue);
        $this->setResponse('doi', $doiValue);

        if ($doi === null) {
            $this->setResponse('responsecode', 'MT011');
            return true;
        }

        // check if this client owns this doi
        if (!$this->isDoiAuthenticatedClients($doiValue, $doi->client_id)) {
            $this->setResponse('responsecode', 'MT008');
            $this->setResponse('verbosemessage', $doiValue . " is not owned by " . $this->getAuthenticatedClient()->client_name);
            return false;
        }

        $this->setResponse('responsecode', 'MT019');
        $this->setResponse('verbosemessage', $doi->status);

        return true;

    }