@param string $method property or method
@param bool $returnValue

@return $this|Collection
492481
public function getDistinct(string $method, bool $returnValue = true)
    {
        $isMethod = null;

        $array = [];

        foreach ($this->elements as $item) {
            $value = $this->elementMethodCall($method, $item, $isMethod);

            if (!in_array($value, $array, true)) {
                $array[] = $returnValue ? $value : $item;
            }
        }

        $clone = clone $this;
        $clone->elements = array_unique($array, SORT_REGULAR);

        return $clone;
    }
1109954
public function createObjectType() : ObjectConstructorCallbackDefiner
    {
        return new ObjectConstructorCallbackDefiner($this->class, function (callable $typeCallback) {
            $this->createObjectCallback = function (array $input) use ($typeCallback) {
                $className = $this->class->getClassName();

                /** @var ValueObject $valueObject */
                $valueObject = $typeCallback($input);

                if (!($valueObject instanceof $className)) {
                    throw InvalidReturnValueException::format(
                        'Invalid create object callback return value: expecting class compatible with %s, %s given',
                        $className, is_string($valueObject) ? $valueObject : Debug::getType($valueObject)
                    );
                }

                return $valueObject;
            };
        });
    }
987715
protected function callScssFunction($name, $argValues, &$returnValue)
    {
        $func = $this->get(static::$namespaces['function'] . $name, false);

        if (! $func) {
            return false;
        }

        $this->pushEnv();

        $storeEnv = $this->storeEnv;
        $this->storeEnv = $this->env;

        // set the args
        if (isset($func->args)) {
            $this->applyArguments($func->args, $argValues);
        }

        // throw away lines and children
        $tmp = new OutputBlock;
        $tmp->lines    = [];
        $tmp->children = [];

        $this->env->marker = 'function';
        $this->pushCallStack($this->env->marker . " " . $name);

        $ret = $this->compileChildren($func->children, $tmp);

        $this->popCallStack();

        $this->storeEnv = $storeEnv;

        $this->popEnv();

        $returnValue = ! isset($ret) ? static::$defaultValue : $ret;

        return true;
    }
372224
public function method($method = null)
    {
        if ($method === null) {
            return $this->get('REQUEST_METHOD');
        }
        $this->set("REQUEST_METHOD", $method);
        return $this;
    }
161199
public static function in($value, array $array, $returnKey = false)
    {
        $inArray = in_array($value, $array, true);

        if ($returnKey) {
            if ($inArray) {
                return array_search($value, $array, true);
            }

            return null;
        }

        return $inArray;
    }
910867
protected function valueAccessor($value, $returnNull = false)
    {
        if (Support::isCallable($value)) {
            return $value;
        }

        return function ($item) use ($value, $returnNull) {
            if (is_null($value)) {
                return $returnNull ? null : $item;
            }
            if (Support::isTraversable($item)) {
                return array_key_exists($value, $item) ? $item[$value] : null;
            }
            if (is_object($item) && isset($item->{$value})) {
                return $item->{$value};
            }
            if (is_object($item) && method_exists($item, $value)) {
                return $item->{$value}();
            }
            if (is_object($item) && method_exists($item, 'get' . ucwords($value))) {
                return $item->{'get' . ucwords($value)}();
            }

            return $returnNull ? null : $item;
        };
    }
1373469
public function setValue($rawValue)
    {
        if ($rawValue === null) {
            $this->value = null;
            return $this;
        }
        if (is_object($rawValue) && $rawValue instanceof $this->dataType) {
            $this->value = $rawValue;
            return $this;
        }
        $this->value = $this->propertyMapper->convert($rawValue, $this->dataType, $this->getPropertyMappingConfiguration());
        $this->validationResults = $this->propertyMapper->getMessages();
        if ($this->validator !== null) {
            $validationMessages = $this->validator->validate($this->value);
            $this->validationResults->merge($validationMessages);
        }

        return $this;
    }
509447
public function invoke(MethodInvocation $invocation)
    {
        $ro = $invocation->proceed();
        if (! $ro instanceof ResourceObject) {
            throw new ReturnValueIsNotResourceObjectException(\get_class($invocation->getThis()));
        }

        if ($ro->code >= Code::BAD_REQUEST) {
            return $this;
        }

        foreach ($this->commands as $command) {
            $command->command($invocation, $ro);
        }

        return $ro;
    }
21439
public function returns($returnValue): self
    {
        if ($this->returnVoid) {
            throw new \LogicException(
                'Trying to map function ' . $this->name
                . '(), but it is declared as returning void.'
            );
        }

        $this->callMap = new CallMap(['function' => $returnValue]);
        return $this;
    }
1217976
public function method($method)
    {
        // Convert to an array if needed
        if (!is_array($method)) {
            $method = [$method];
        }

        $this->method = $method;
        return $this;
    }
1354755
public function select(array $criteria = array(),
            $return = Table::RETURN_MODEL) {
        if (!$this->checkExists()) {
            return ($this->delayExecute) ? $this : new ArrayCollection();
        }

        $this->current = self::OP_SELECT;

        $this->query = 'SELECT ' . $this->prepareColumns();
        $this->query .= ' FROM `' . $this->name . '`' . $this->processJoins();

        $this->where($criteria);

        $this->setExpectedResult($return, true);
        if ($this->delayExecute) {
            return $this;
        }
        return $this->execute();
    }
718904
protected static function newResponse($returnType = BaseSearch::SEARCH_RESULT)
    {
        switch ($returnType) {
            case BaseSearch::SEARCH_COUNT:
                return new CountResponse();
                break;
            case BaseSearch::SEARCH_RESULT:
                return new ResultResponse();
                break;
            case BaseSearch::SEARCH_IDS:
                return new IdsResponse();
                break;
            case BaseSearch::SEARCH_QUERY:
            default:
                return new QueryResponse();
                break;
        }
    }
928191
protected function shouldNotRenderTemplate($controller, $returnValue)
    {
        if ($controller instanceof Controller) {
            if ($controller->getHeaders()->has('location')) {
                return true;
            }
        }

        return $returnValue === false;
    }
445744
public function findOneBy($column, $value, $returnType = Table::RETURN_MODEL) {
        return $this->findOneWhere(array(array($column => $value)), $returnType);
    }
978915
public function run($sendValue=null){
            
            if($sendValue!==null) $this->sendValue = $sendValue;
            
            //Compatible the first item.
            
            if($this->beforeFirstYield){
                
                //Make the flag false.
                $this->beforeFirstYield = false;
                
                //Return the current return value.
                return $this->Generator->current();
                
            }else{
                
                /**
                 * Var $return
                 * The return value.
                 * 
                 */
                $return = $this->Generator->send($this->sendValue);
                
                //Clear the sendValue
                $this->sendValue = null;
                
                //Return the Return value
                return $return;
                
            }
            
        }
202239
public function fetchAll($returnType = Table::RETURN_MODEL) {
        $return = $this->select(array(), $returnType);
        if (is_a($return, 'DBScribe\Table')) $return = $return->execute();
        if (is_bool($return)) return new ArrayCollection();

        return $return;
    }
535828
public static function setMethod($method = 'auto')
    {
        if (!\in_array($method, ['auto', 'curl', 'fopen'], true)) {
            $method = 'auto';
        }

        self::$method = $method;

        return new self();
    }