@param $options

@return bool
189211
private function isShared($options)
    {
        if (!array_key_exists(self::SHARE_KEY, $options)) {
            return true;
        }

        if (is_bool($options[self::SHARE_KEY])) {
            return $options[self::SHARE_KEY];
        }
        if (is_numeric($options[self::SHARE_KEY])) {
            $shared = $options[self::SHARE_KEY] * 1;

            return ($shared <= 0) ? false : true;
        }

        if ($options[self::SHARE_KEY] == 'true') {
            return true;
        } else {
            return false;
        }
    }
236405
public function email(array $options) {
        if (empty($this->elementData) || filter_var($this->elementData, FILTER_VALIDATE_EMAIL)) {
            $this->elementData = filter_var($this->elementData, FILTER_SANITIZE_EMAIL);
            return true;
        }

        $this->addError($this->checkMessage('Invalid email adddress', $options));
        return false;
    }
920787
public function has(string $index, array $options = []) : bool
    {
        $separator = isset($options['separator']) ?
            $options['separator'] :
            $this->getOption('separator', '.');
        $value = $this->getData();
        $keys = explode($separator, $index);

        foreach ($keys as $key) {
            if (!is_array($value) || !array_key_exists($key, $value)) {
                return false;
            }

            $value = $value[$key];
        }

        return true;
    }
17840
public function modified($options = [])
    {
        $options += ['embed' => false];

        if ($this->_modified) {
          return true;
        }

        foreach ($this->_data as $index => $entity) {
            if (is_object($entity) && method_exists($entity, 'modified') && $entity->modified($options)) {
                return true;
            }
        }
        return false;
    }
1306599
public function isValid($value = null, array $options = []): bool
    {
        if (\count($options) > 0) {
            $this->setOptions($options);
        }
        $this->setValue($value);
        $this->errors = [];

        return $this->validateDateTime();
    }
546434
public function checkClasses($classes, array $options)
    {
        if (empty($options['class'])) {
            return false;
        }

        $options['class'] = $this->_toClassArray($options['class']);
        $classes = $this->_toClassArray($classes);

        foreach ($classes as $class) {
            if (!in_array($class, $options['class'])) {
                return false;
            }
        }

        return true;
    }
1293512
public function checkMessages(array $options = [])
    {
        $this->buildCall('/text');

        $rawMessages = $this->getRequest()->xml();

        return $this->makeMessages($rawMessages->Text);
    }
413806
public function setPossibleOptions( $options )
	{
		if( !is_array( $options ) )														//  no Array given
			throw InvalidArgumentException( 'No array given.' );						//  throw Exception
		if( $options === $this->possibleOptions )										//  threse Options are already set
			return FALSE;																//  do nothing
		$this->possibleOptions	= $options;												//  set new Options
		return TRUE;																	//  indicate Success
	}
1097492
public function login($options = []) {
		$options = Hash::merge($this->getConfig('login'), $options);
		$this->_handleUserBeingAlreadyLoggedIn($options);
		$entity = $this->UserTable->newEntity(null, ['validate' => false]);

		if ($this->_getRequest()->is('post')) {
			$user = $this->_beforeLogin($entity, $options);
			if ($user) {
				return $this->_afterLogin($user, $options);
			} else {
				$this->handleFlashAndRedirect('error', $options);
			}
		}

		if ($options['setEntity']) {
			$this->_setViewVar('userEntity', $entity);
		}

		return false;
	}
1198560
public function exists(array $options = [])
    {
        try {
            $this->connection->getObject($this->identity + $options + ['fields' => 'name']);
        } catch (NotFoundException $ex) {
            return false;
        }

        return true;
    }
1341975
public function validate(array $options = array()) {
        $validated= false;
        if ($validator= $this->getValidator()) {
            $validated= $this->_validator->validate($options);
            if ($this->xpdo->getDebug() === true) {
                $this->xpdo->log(xPDO::LOG_LEVEL_DEBUG, "Validator class executed, result = " . print_r($validated, true));
            }
        } else {
            if ($this->xpdo->getDebug() === true) {
                $this->xpdo->log(xPDO::LOG_LEVEL_DEBUG, "No validator found for {$this->_class} instance.");
            }
            $validated= true;
        }
        return $validated;
    }
681563
public function setOptions(array $options)
    {
        if (isset($options['on_update'])) {
            $this->autoUpdate($options['on_update']);
        } elseif (isset($options['auto_update'])) {
            $this->autoUpdate();
        }

        return parent::setOptions($options);
    }
749334
public function setOptions($options)
	{
		$options = is_array($options) ? $options : array($options);

		foreach ($options as $option)
		{
			$this->addOption($option);
		}

		return $this;
	}
1195659
public function setOptions($options = [])
    {
        $this->options = $options;
        $this->debug->info(__FUNCTION__, 'setOptions: ', $this->options);

        return $this;
    }
214881
public function set_options(array $options)
	{
		foreach ($options as $key => $val)
		{
			$this->options[$key] = $val;
		}

		return $this;
	}
1221999
public function truncate(array $options): bool
    {
        $options = array_replace($this->defaultOptions, $options);
        $nItems = [];
        foreach (array_reverse($this->props['items']) as $item) {
            $f = $this->filterItem($item, $options);
            if ($f) {
                if ($f !== self::FILTER_LEFT) {
                    $nItems[] = $item;
                }
                $this->props['items'] = array_reverse($nItems);
                return true;
            }
            $nItems[] = $item;
        }
        return false;
    }
925188
public function setOptions(array $options)
    {
        foreach ($options as $opt => $val) {
            $this->setOption($opt, $val);
        }

        return $this;
    }