FactoryGirl\Provider\Doctrine\FixtureFactory::get PHP Method

get() public method

Whether the entity is new or not depends on whether you've created a singleton with the entity name. See getAsSingleton(). If you've called persistOnGet() then the entity is also persisted.
public get ( $name, array $fieldOverrides = [] )
$fieldOverrides array
    public function get($name, array $fieldOverrides = array())
    {
        if (isset($this->singletons[$name])) {
            return $this->singletons[$name];
        }
        $def = $this->entityDefs[$name];
        $config = $def->getConfig();
        $this->checkFieldOverrides($def, $fieldOverrides);
        $ent = $def->getEntityMetadata()->newInstance();
        $fieldValues = array();
        foreach ($def->getFieldDefs() as $fieldName => $fieldDef) {
            $fieldValues[$fieldName] = array_key_exists($fieldName, $fieldOverrides) ? $fieldOverrides[$fieldName] : $fieldDef($this);
        }
        foreach ($fieldValues as $fieldName => $fieldValue) {
            $this->setField($ent, $def, $fieldName, $fieldValue);
        }
        if (isset($config['afterCreate'])) {
            $config['afterCreate']($ent, $fieldValues);
        }
        if ($this->persist) {
            $this->em->persist($ent);
        }
        return $ent;
    }