когда я отправляю форму state errors возвращается старый
class Product extends ActiveRecord
{
public function getCategory(){
return $this->hasOne(Category::className(), ['id' => 'category_id']);
}
}
class Product
{
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Category", inversedBy="products")
*/
private $category;
public function getCategory(): ?Category
{
return $this->category;
}
public function setCategory(?Category $category): self
{
$this->category = $category;
return $this;
}
}
class Product(models.Model):
company = models.OneToOneField(Category)