lib/db/cortex.php
public function has($key, $filter, $options = null) {
		if (is_string($filter))
			$filter=array($filter);
		if (is_int(strpos($key,'.'))) {
			list($key,$fkey) = explode('.',$key,2);
			if (!isset($this->hasCond[$key.'.']))
				$this->hasCond[$key.'.'] = array();
			$this->hasCond[$key.'.'][$fkey] = array($filter,$options);
		} else {
			if (!isset($this->fieldConf[$key]))
				trigger_error(sprintf(self::E_UNKNOWN_FIELD,$key,get_called_class()),E_USER_ERROR);
			if (!isset($this->fieldConf[$key]['relType']))
				trigger_error(self::E_HAS_COND,E_USER_ERROR);
			$this->hasCond[$key] = array($filter,$options);
		}
		return $this;
	}
public function has($key, $filter, $options = null) {
		if (is_string($filter))
			$filter=array($filter);
		if (is_int(strpos($key,'.'))) {
			list($key,$fkey) = explode('.',$key,2);
			if (!isset($this->hasCond[$key.'.']))
				$this->hasCond[$key.'.'] = array();
			$this->hasCond[$key.'.'][$fkey] = array($filter,$options);
		} else {
			if (!isset($this->fieldConf[$key]))
				trigger_error(sprintf(self::E_UNKNOWN_FIELD,$key,get_called_class()),E_USER_ERROR);
			if (!isset($this->fieldConf[$key]['relType']))
				trigger_error(self::E_HAS_COND,E_USER_ERROR);
			$this->hasCond[$key] = array($filter,$options);
		}
		return $this;
	}
public function has ( $ key , $ filter , $ options = null ) { if ( is_string ( $ filter ) ) $ filter = array ( $ filter ) ; if ( is_int ( strpos ( $ key , '.' ) ) ) { list ( $ key , $ fkey ) = explode ( '.' , $ key , 2 ) ; if ( ! isset ( $ this -> hasCond [ $ key . '.' ] ) ) $ this -> hasCond [ $ key . '.' ] = array ( ) ; $ this -> hasCond [ $ key . '.' ] [ $ fkey ] = array ( $ filter , $ options ) ; } else { if ( ! isset ( $ this -> fieldConf [ $ key ] ) ) trigger_error ( sprintf ( self :: E_UNKNOWN_FIELD , $ key , get_called_class ( ) ) , E_USER_ERROR ) ; if ( ! isset ( $ this -> fieldConf [ $ key ] [ 'relType' ] ) ) trigger_error ( self :: E_HAS_COND , E_USER_ERROR ) ; $ this -> hasCond [ $ key ] = array ( $ filter , $ options ) ; } return $ this ; }
add has-conditional filter to next find call
@param string $key
@param array $filter
@param null $options
@return $this
add has - conditional filter to next find call