Adds a 'post_type' condition
@param  string $type
@return Query
435439
public function type($type = null)
    {
        if (is_null($type)) {
            unset($this->filters['post_type']);
        } else {
            $this->filters['post_type'] = $type;
        }
        return $this;
    }
1133978
public function addType(PaginateInterface $type, array $extensions = [])
    {
        $this->typeList[get_class($type)] = $type;
        foreach ($extensions as $extension) {
            $this->addTypeExtension($type, $extension);
        }

        return $this;
    }
1326399
protected function andRelationToPostIn($query_type)
    {
        $andQuery = new Query();

        // Copy the current Query but remove the OR conditions.
        // They will be looked up as this instance goes on with
        // the process.
        $filterCopy = $this->filters;

        unset($filterCopy["limit"]);
        unset($filterCopy["posts_per_page"]);
        $filterCopy[$query_type]["OR"] = array();
        $filterCopy['nopaging'] = true;

        $andQuery->applyFilters($filterCopy);
        $andQuery->resetQueryRelation($query_type, 'OR');

        // This forces the AND relationships to be loaded before
        // comparing the or parameters
        $andIds = $andQuery->listing("ID", "ID");

        $this->where('post__in', array_values($andIds));
        $this->resetQueryRelation($query_type, 'AND');

        return $this;
    }
687132
public static function post($key = null, $type = 'string', $defaultValue = '')
    {
        if (!$key) {
            return $_POST;
        }
        return self::typeConvert(isset($_POST[$key]) ? $_POST[$key] : $defaultValue, $type);
    }
247290
public function mustBeTypeOf(string $type) : Slot
    {
        static $allowed_types = [
            'boolean',
            'bool',
            'integer',
            'int',
            'float',
            'double',
            'string',
            'array',
            'object',
            'resource',
            'NULL',
            'null',
        ];
        $this->type = in_array($type,$allowed_types) ? $type : self::TYPE_ANY;
        return $this;
    }
730187
public function setPostFields($fields, string $type = self::ENCODE_QUERY)
    {
        if (is_array($fields)) {
            if ($type === self::ENCODE_JSON) {
                 $fields = json_encode($fields);
            } else {
                 $fields = http_build_query($fields);
            }
        }

        $this->options[CURLOPT_POSTFIELDS] = $fields;

        return $this;
    }
23590
public function index($type = null)
    {
        // setting up an event for the index
        $_event = new Event('Controller.PostTypes.beforeIndex.' . $this->_type, $this, [
        ]);
        $this->eventManager()->dispatch($_event);

        $this->paginate = [
            'limit' => 25,
            'order' => [
                ucfirst($type) . '.id' => 'asc'
            ]
        ];

        foreach ($this->Settings['filters'] as $key => $value) {
            if (is_array($value)) {
                $this->Search->addFilter($key, $value);
            } else {
                $this->Search->addFilter($value);
            }
        }

        $query = $this->Search->search($this->Model->find('all'));

        $this->set('types', $this->paginate($query));

        // setting up an event for the index
        $_event = new Event('Controller.PostTypes.afterIndex.' . $this->_type, $this, [
        ]);
        $this->eventManager()->dispatch($_event);


        if (!$this->Settings['views']['index']) {
            $this->render(Configure::read('PostTypes.AdminPostTypeViews.index'));
            return;
        }

        $this->render($this->Settings['views']['index']);
    }
1010781
public function newQuery($type = 'select')
    {
        $query = $this->getDB()->newQuery($type);
        $query->cols("`" . $this->getTable() . "`.*");
        $query->from($this->getFullNameTable());
        $query->table($this->getTable());

        return $query;
    }
745815
protected function filterByType(string $type)
    {
        if (!$this->files) {
            return new Sequence();
        }

        return new Sequence(
            array_filter(
                $this->files,
                function (StatusFile $statusFile) use ($type) {
                    return $type === $statusFile->getIndexStatus();
                }
            )
        );
    }
515545
public function index($type = null)
    {
        $this->_validateActionIsEnabled('index');

        $this->_event('beforeIndex');

        $this->paginate = [
            'limit' => 25,
            'order' => [
                ucfirst($this->Model->alias()) . '.id' => 'asc'
            ]
        ];

        foreach ($this->type['filters'] as $key => $value) {
            if (is_array($value)) {
                $this->Search->addFilter($key, $value);
            } else {
                $this->Search->addFilter($value);
            }
        }

        $query = $this->_callQuery($this->Model->find('all'));
        $query = $this->Search->search($query);

        $this->set('data', $this->paginate($query));

        $this->_event('afterIndex');
    }
1204155
public function addType($type)
    {
        if (func_num_args() > 1) {
            foreach (func_get_args() as $t) {
                $this->addType($t);
            }
        } else {
            if (is_array($type)) {
                foreach ($type as $t) {
                    $this->addType($t);
                }
            } else {
                if (!$this->typeIsAvailable($type)) {
                    $this->types[] = $type;
                }
            }
        }

        return $this;
    }
416202
public function trigger($type)
    {
        if (isset($this->callbacks[$type])) {
            foreach ($this->callbacks[$type] as $cb) {
                \pwf\helpers\SystemHelpers::call($this->prepareCallback($cb));
            }
        }
        return $this;
    }
156963
public function getQuery(string $type = 'select', ...$arguments): QueryObject
    {
        $allowedTypes = [
            'select',
            'insert',
            'insertignore',
            'replace',
            'delete',
            'update',
            'criteriaonly',
        ];

        if (\in_array(strtolower($type), $allowedTypes, true) === false) {
            throw new Exception($type . ' is not a known type.', 1);
        }

        $queryArr = $this->adapterInstance->$type($this->statements, ...$arguments);

        return new QueryObject($queryArr['sql'], $queryArr['bindings'], $this->getConnection());
    }
1364765
public function addType($type)
    {
        if ($type instanceof Type) {
            $type = $type->getName();
        }

        if (!\is_string($type)) {
            throw new InvalidException('Invalid type type');
        }

        $this->_types[] = $type;

        return $this;
    }
853075
public function setType(Type $type = null)
    {
        if ($this->type !== $type) {
            // romove link on this item for old type
            if ($this->type instanceof Type) {
                $tmp = $this->type;
                $this->type = null;
                $tmp->removeItem($this);
            }
            $this->type = $type;
            // add link on this item
            if ($this->type instanceof Type) {
                $this->type->addItem($this);
            }
        }

        return $this;
    }
929515
public function type($type=null)
    {
        if (isset($type)) {
            $this->data['type'] = $type;
            return $this;
        }
        
        return isset($this->data['type']) ? $this->data['type'] : 'select';
    }
618520
public function post($key, $type = 'string', $default = null)
    {
        $value = $default;
        if (isset($this->post[$key])) {
            $value = $this->post[$key];
        }
        settype($value, $type);
        return $value;
    }