In my Symfony 6 project, I am trying to load a fixture:
/**
* @param ObjectManager $manager
*/
public function load(ObjectManager $manager): void
{
$manager1 = $manager;
$manager1->persist($this->persistCompanyOne());
$manager1->flush();
}
private function persistCompanyOne(): Company
{
$company = new Company();
$company->setCompanyName('Company One');
return $company;
}
And my Company entity:
/**
* @ORM\Column(type="string", length=180, nullable=false)
*/
private string $companyName;
/**
* @return string
*/
public function getCompanyName(): string
{
return $this->name;
}
/**
* @param mixed
* @return Company
*/
public function setCompanyName(string $name): Company
{
$this->name = $name;
return $this;
}
When running php bin/console doctrine:fixtures:load
I get an error:
Integrity constraint violation: 1048 Column 'company_name' cannot be null
Can not figure out what can be the problem? it’s pretty straightforward..
You may also like…
- Why fluentd loss most of it's log while using http output plugin (in similar timestamp)
- Java Mouse Listener – Can event type be detected inside of an event?
- flutter build ipa works locally, but not when run on github actions on the same machine
- CSS Imported by a Dependency
- Module '"rxjs"' has no exported member 'firstValueFrom'
- what use spring multiple handler websocket session service
- Failing to increment pair count correctly add_pairs Tideman CS50
- How can I get the average cost from a specific column from a table in R
- The theme system is not working for me and I'm not sure why
- Sorting multiple rows of un-sorted data based on text string – GSheets
- Tkinter RuntimeError: main thread is not in main loop when trying to insert item into listbox from different thread
- SwiftUI: Generating a continuous alphabetical list (from a-z then from aa, bb, cc, …, aaa, bbb, ccc)
- AWS Eventbridge rule trigger once all in-flight sqs messages are processed
- Avoid calling a method in a loop
- How to add a single value in datagridview with c#?
- MenuItem with onClick={popupState.close} in Material-ui V 5.0 how to execute a Link to open the component?
amazon-web-services android angular api arrays c# css dart dataframe django docker excel express firebase flutter html ios java javascript jquery json kotlin laravel linux list mongodb mysql node.js pandas php postgresql python python-3.x r react-native reactjs regex spring spring-boot sql sql-server string swift typescript vue.js