Removed field from object
@param string|array $fields
@return $this
504891
public function unsetField($fields)
    {
        $fields = (array)$fields;
        foreach ($fields as $field) {
            unset($this->data[$field]);
        }

        return $this;
    }
267880
public function setFields($fields): self
    {
        if (!is_iterable($fields)) {
            throw new Exception(sprintf('%s() expects argument passed to be iterable, %s given', __METHOD__, gettype($fields)));
        }

        $this->fields = [];
        foreach ($fields as $field) {
            $this->addField(...$field);
        }

        return $this;
    }
1357246
public static function unsetFields($array, $fields = null)
    {
        if (!is_array($array)) {
            $fields = [];
        }
        foreach ($array as $key => $value) {
            if (is_string($key) && in_array($key, $fields)) {
                unset($array[$key]);
            }
        }
        return $array;
    }
525960
public function addFields($fields)
    {
        foreach ($fields as $field) {
            if (is_array($field)) {
                $this->addField(...$field);
            } else {
                $this->addField($field);
            }
        }

        return $this;
    }
1205430
public function except($fields)
    {
        $fields = (array) $fields;

        return $this->map(
            static function (Data $data) use ($fields) {
                return $data->except($fields);
            }
        );
    }
460126
public function with(...$fields) {
        foreach ($fields as $f) {
            $this->eagerFields[ $f ] = $f;
        }

        return $this;
    }
959518
public function removeField($field)
    {
        $this->checkValidLoader();

        if (in_array($field, $this->loaders[ $this->contextLoader ])) {
            array_splice(
                $this->loaders[ $this->contextLoader ],
                array_search($field, $this->loaders[ $this->contextLoader ])
            );
        }

        return $this;
    }
174803
public function setFields(array $fields)
    {
        $this->fields = [];

        foreach ($fields as $type => $field) {
            //Remove empty and repeated fields
            $this->fields[$type] = array_unique(array_filter(explode(',', $field)));
        }

        return $this;
    }
1024287
public function setFields($fields = [])
    {
        $existingSchema = $this->get();

        $request = [];
        foreach ($fields as $field) {
            $mode = $this->hasField($field['name'], $existingSchema) ? 'replace-field' : 'add-field';
            $request[$mode][] = $field;
        }

        return $this->request($request);
    }
531792
public function sort($fields)
    {
        $fields = $this->unitOfWork
            ->getDocumentPersister($this->class->name)
            ->prepareSortOrProjection($fields);

        $this->baseCursor->sort($fields);
        return $this;
    }
263257
public function removeSort($field) {
		foreach ($this->sorts as $key => $value) {
			if ($value['field'] == $field) {
				unset($this->sorts[$key]);
			}
		}

		return $this;
	}
207834
public function addLockFields($fields)
    {
        $fields = explode(',', str_replace(' ', '', $fields));
        $this->lockedFields = array_merge($this->lockedFields, $fields);
        return $this;
    }
1325635
public function remove($attributes)
    {
        foreach ((array) $attributes as $attribute) {
            unset($this->defaults[$attribute],
                $this->types[$attribute],
                $this->requires[$attribute],
                $this->notNullables[$attribute]);
        }

        return $this;
    }
901324
public function addRequiredFields($fields)
    {
        if (ArrayLib::is_associative($fields)) {
            
            foreach ($fields as $name => $message) {
                $this->addRequiredField($name, $message);
            }
            
        } else {
            
            foreach ($fields as $name) {
                $this->addRequiredField($name);
            }
            
        }
        
        return $this;
    }
519001
public function remove($field)
    {
        if (! is_array($field)) {
            $field = func_get_args();
        }

        foreach ($field as $f) {
            $this->update('$unset', $f, 1);
        }

        return $this;
    }
1139127
public function groupBy($fields)
    {
        $fields = is_array($fields) ? $fields : func_get_args();
        $this->groupBy = array_merge($this->groupBy, $fields);
        return $this;
    }
954177
public function select($fields = [])
    {
        if (is_array($fields)) {
            foreach ($fields as $field) {
                $this->addSelect($field);
            }
        } elseif (is_string($fields)) {
            $this->addSelect($fields);
        }

        return $this;
    }