nasıl Symfony'de model alan için bir değer tanımlayabilirsiniz?

0 Cevap php

I'm building an app for the company I work for in symfony, non the less the app might be pretty useful outside our company so we decided to write it in a more general form so we can make it multi company. I'm facing a problem on how to define a default value for a field that is going to be in every single model (company_id) so we don't need to select which company we belong to every time we want to add data. can anyone help me? I've tried

class TestForm extends BaseTestForm
{

    function configure()
    {
        $this->setDefault('company_id', '1');
    }
}

Ben formu göndermek zaman ve ben model için bir eksik değeri olsun ....

0 Cevap