lib/db/cortex.php
public function getSubset($prop, $keys) {
		if (is_string($keys))
			$keys = \Base::instance()->split($keys);
		if (!is_array($keys))
			trigger_error(sprintf(self::E_SubsetKeysValue,gettype($keys)),E_USER_ERROR);
		if (!$this->hasRelSet($prop) || !($relSet = $this->getRelSet($prop)))
			return null;
		foreach ($keys as &$key) {
			if ($key instanceof \MongoId || $key instanceof \MongoDB\BSON\ObjectId)
				$key = (string) $key;
			unset($key);
		}
		return array_values(array_intersect_key($relSet, array_flip($keys)));
	}
public function getSubset($prop, $keys) {
		if (is_string($keys))
			$keys = \Base::instance()->split($keys);
		if (!is_array($keys))
			trigger_error(sprintf(self::E_SubsetKeysValue,gettype($keys)),E_USER_ERROR);
		if (!$this->hasRelSet($prop) || !($relSet = $this->getRelSet($prop)))
			return null;
		foreach ($keys as &$key) {
			if ($key instanceof \MongoId || $key instanceof \MongoDB\BSON\ObjectId)
				$key = (string) $key;
			unset($key);
		}
		return array_values(array_intersect_key($relSet, array_flip($keys)));
	}
public function getSubset ( $ prop , $ keys ) { if ( is_string ( $ keys ) ) $ keys = \ Base :: instance ( ) -> split ( $ keys ) ; if ( ! is_array ( $ keys ) ) trigger_error ( sprintf ( self :: E_SubsetKeysValue , gettype ( $ keys ) ) , E_USER_ERROR ) ; if ( ! $ this -> hasRelSet ( $ prop ) || ! ( $ relSet = $ this -> getRelSet ( $ prop ) ) ) return null ; foreach ( $ keys as & $ key ) { if ( $ key instanceof \ MongoId || $ key instanceof \ MongoDB \ BSON \ ObjectId ) $ key = ( string ) $ key ; unset ( $ key ) ; } return array_values ( array_intersect_key ( $ relSet , array_flip ( $ keys ) ) ) ; }
get an intersection from a cached relation-set, based on given keys
@param string $prop
@param array|string $keys
@return array
get an intersection from a cached relation - set based on given keys