@param callback $fn
@param callback [$fieldFn]

@return $this
480559
public function each($fn, $fieldFn = null)
	{
		$setBean = $this->getBean();
		$fields = $this->fields;
		$directives = $this->directives;

		if ($fieldFn === null) {
			foreach ( $setBean->{'ownSkemarecord' . $this->cleanBaseName . 'List'} as $id => $recordBean ) {
				$values          = [ ];

				$recordID = $recordBean->getID();

				foreach ( $fields as $cleanName => $field ) {
					$directive = Type::Directive($directives[ $cleanName ])
						->setValue( $recordBean->{$cleanName}, $recordID );

					switch ($this->keyType) {
						default:
						case self::$keysID:
							$key = $fields[$cleanName]->getBean()->getID();
							break;
						case self::$keysClean:
							$key = $cleanName;
							break;
						case self::$keysDirty:
							$key = $fields[$cleanName]->name;
							break;
					}

					$values[ $key ] = $directive;
				}

				$fn( $values, $recordID, $this, $recordBean, $this->keyType );
			}
		} else {
			foreach ( $setBean->{'ownSkemarecord' . $this->cleanBaseName . 'List'} as $id => $recordBean ) {
				$processedValues = [ ];

				foreach ( $fields as $cleanName => $field ) {
					$directive = Type::Directive($directives[ $cleanName ])
						->setValue( $recordBean->{$cleanName}, $recordBean->getID() );

					switch ($this->keyType) {
						default:
						case self::$keysID:
							$key = $fields[$cleanName]->getBean()->getID();
							break;
						case self::$keysClean:
							$key = $cleanName;
							break;
						case self::$keysDirty:
							$key = $fields[$cleanName]->name;
							break;
					}

					$processedValues[ $key ] = $fieldFn( $directive );
				}

				$fn( $processedValues );
			}
		}

		return $this;
	}
1170438
public static function before_all($fn)
    {
        $test_method = new BeforeAllHook(InvocationContext::getActive(), $fn);
        $test_method->addToParent();
        return $test_method;
    }
1256269
public function generatedValue(callable $callback = null)
    {
        $generatedValue = new GeneratedValue($this->fieldBuilder, $this->classMetadata);

        if ($callback) {
            $callback($generatedValue);
        }

        $generatedValue->build();

        return $this;
    }
1153326
public function add(string $fieldName, float $boost = 1.0): AbstractFieldList
    {
        $this->fieldList[$fieldName] = (float)$boost;
        return $this;
    }
1028575
function addRule($field, $callback) {
        if (isset($this->rules[$field])) {
            array_unshift($this->rules[$field], $callback);
        }

        return $this;
    }
696768
public function filterByLabel(callable $fn) : self
    {
        $samples = $labels = [];

        foreach ($this->labels as $i => $label) {
            if ($fn($label)) {
                $samples[] = $this->samples[$i];
                $labels[] = $label;
            }
        }

        return self::quick($samples, $labels);
    }
1314398
public function setEntityHasField(string $entityFqn, string $fieldFqn): void
    {
        try {
            $entityReflection          = new \ts\Reflection\ReflectionClass($entityFqn);
            $entity                    = PhpClass::fromFile($entityReflection->getFileName());
            $entityInterfaceFqn        = $this->namespaceHelper->getEntityInterfaceFromEntityFqn($entityFqn);
            $entityInterfaceReflection = new \ts\Reflection\ReflectionClass($entityInterfaceFqn);
            $entityInterface           = PhpInterface::fromFile($entityInterfaceReflection->getFileName());
            $fieldReflection           = new \ts\Reflection\ReflectionClass($fieldFqn);
            $field                     = PhpTrait::fromFile($fieldReflection->getFileName());
            $fieldInterfaceFqn         = \str_replace(
                ['Traits', 'Trait'],
                ['Interfaces', 'Interface'],
                $fieldFqn
            );
            $fieldInterfaceReflection  = new \ts\Reflection\ReflectionClass($fieldInterfaceFqn);
            $this->checkInterfaceLooksLikeField($fieldInterfaceReflection);
            $fieldInterface = PhpInterface::fromFile($fieldInterfaceReflection->getFileName());
        } catch (\Exception $e) {
            throw new DoctrineStaticMetaException(
                'Failed loading the entity or field from FQN: ' . $e->getMessage(),
                $e->getCode(),
                $e
            );
        }
        if ($this->alreadyUsingFieldWithThisShortName($entity, $field)) {
            throw new \InvalidArgumentException(
                'Entity already has a field with the the short name: ' . $field->getName()
                . "\n\nUse statements:" . print_r($entity->getUseStatements(), true)
                . "\n\nProperty names:" . print_r($entity->getPropertyNames(), true)
            );
        }
        $entity->addTrait($field);
        $this->codeHelper->generate($entity, $entityReflection->getFileName());
        $entityInterface->addInterface($fieldInterface);
        $this->codeHelper->generate($entityInterface, $entityInterfaceReflection->getFileName());
        if ($this->fieldHasFakerProvider($fieldReflection)) {
            $this->updater->updateFakerProviderArrayWithFieldFakerData($this->pathToProjectRoot, $fieldFqn, $entityFqn);
        }
        $this->dataTransferObjectCreator->setNewObjectFqnFromEntityFqn($entityFqn)
                                        ->setProjectRootDirectory($this->pathToProjectRoot)
                                        ->setProjectRootNamespace($this->projectRootNamespace)
                                        ->createTargetFileObject()
                                        ->write();
    }
683150
public function sort(callable $fn)
    {
        $items = $this->items;
        usort($items, $fn);

        return new self($items);
    }
159405
function (fn) {
    if (fn.length === 0) {
      fn = _.wrap(fn, function(func, callback) {
        callback(null, func());
      });
    }

    this.getNewId = fn;

    return this;
  }
593094
public function select ($fn)
	{
		if (!is_callable($fn) && is_an_array($fn)) {
			$keys = V($fn);

			$fn = function ($key, $value) use ($keys) {
				return $keys->includes($key);
			};
		}

		$result = new self();

		foreach ($this->storage as $key => $value) {
			if ($fn($key, $value)) {
				$result[$key] = $value;
			}
		}

		return $result;
	}
1240928
protected function setAsInteger($field, $value)
    {
        if (in_array($field, $this->getColumns()) && (
                !array_key_exists($field, $this->object) ||
                $this->object[$field] !== $value
        )) {
            $this->dirtyFields[$field] = true;
        }
        $this->object[$field] = (int) $value;

        return $this;
    }
318581
public function pushField(Field $field)
    {
        $field = $this->formatField($field);

        $this->fields->push($field);

        return $this;
    }
514301
public function set(string $field, $value)
    {
        $this->update();
        $this->mongoDbUpdate['$set'][$field] = $value;

        return $this;
    }
626884
public function set($field, $value) {
        $parser = $this->getParser($field);
        $this->_properties[$field] = $parser->parse($value);
        return $this;
    }
515396
public function append($field, $value)
    {
        $this->resolver->resolveForTyping($field)->sendKeys($value);

        return $this;
    }
121919
public function right($field = 'right', $type = 'integer', callable $callback = null)
    {
        $this->validateNumericField($type, $field);

        $this->mapField($type, $field, $callback);

        $this->right = $field;

        return $this;
    }
1245642
public static function before($fn)
    {
        $test_method = new BeforeHook(InvocationContext::getActive(), $fn);
        $test_method->addToParent();
        return $test_method;
    }