symfony-2.5

Many dependencies in service

不打扰是莪最后的温柔 提交于 2021-01-27 15:19:46
问题 I have trouble with dependencies in my application in service layer. I have following class: <?php class UserService{ private $userRepository; private $vocationService; private $roleService; public function __construct(UserRepository $userRepository, VocationService $vocationService, RoleService $roleService) { $this->userRepository = $userRepository; $this->vocationService = $vocationService; $this->roleService = $roleService; } } There are only three dependencies which I'm injecting. Assume

How to debug a Symfony2 form?

强颜欢笑 提交于 2021-01-27 07:49:19
问题 I'm creating a register page to create a new user based on FOSUserBundle. I go this message on the top f the form every time I submit the new user form: This value should not be blank. Apparently this is a global message and it's not linked to a particular field on my form, so I guess it must be related to any other atribute of my User class. What mechanism Sf2 offers me in order to figure out what's wrong on my form? I am using Symfony 2.5.0 (I would post more details about my configuration,

How to debug a Symfony2 form?

拈花ヽ惹草 提交于 2021-01-27 07:47:42
问题 I'm creating a register page to create a new user based on FOSUserBundle. I go this message on the top f the form every time I submit the new user form: This value should not be blank. Apparently this is a global message and it's not linked to a particular field on my form, so I guess it must be related to any other atribute of my User class. What mechanism Sf2 offers me in order to figure out what's wrong on my form? I am using Symfony 2.5.0 (I would post more details about my configuration,

Symfony2 Embed form on multiple entities

可紊 提交于 2020-01-16 18:48:47
问题 I have 3 entities User class User extends BaseUser { /** * @ORM\OneToMany(targetEntity="UserPathologie", mappedBy="user") */ protected $userPathologies; } Pathologie class Pathologie { /** * @var string * * @ORM\Column(name="nom", type="string", length=255) */ private $nom; /** * @ORM\OneToMany(targetEntity="UserPathologie", mappedBy="pathologie") */ protected $userPathologies; } UserPathologie class UserPathologie { /** * @ORM\ManyToOne(targetEntity="User", inversedBy="userPathologies") */

Symfony2 Embed form on multiple entities

人盡茶涼 提交于 2020-01-16 18:48:09
问题 I have 3 entities User class User extends BaseUser { /** * @ORM\OneToMany(targetEntity="UserPathologie", mappedBy="user") */ protected $userPathologies; } Pathologie class Pathologie { /** * @var string * * @ORM\Column(name="nom", type="string", length=255) */ private $nom; /** * @ORM\OneToMany(targetEntity="UserPathologie", mappedBy="pathologie") */ protected $userPathologies; } UserPathologie class UserPathologie { /** * @ORM\ManyToOne(targetEntity="User", inversedBy="userPathologies") */

Doctrine 2 Native Query select from joined entity

こ雲淡風輕ζ 提交于 2020-01-01 08:38:31
问题 NOTE: This is Native Query specific I have 2 related entites " CrmBusinessPartner " and " RefCountry " and " CrmBusinessPartnerRepository " repository. CrmBusinessPartner entity /** * CrmBusinessPartner * * @ORM\Table(name="crm_business_partner") * @ORM\Entity(repositoryClass="CrmBusinessPartnerRepository") * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false) * @ExclusionPolicy("none") */ class CrmBusinessPartner { /** * * @var integer * * @ORM\ManyToOne(targetEntity="RefCountry",

Deploying Symfony 2.5.3 website to production server

≯℡__Kan透↙ 提交于 2019-12-20 04:10:59
问题 I have been working on a website in development environment built on top of Symfony framework and now it is time to deploy it to live site, in development environment we run the command php app/console server:run to run the website but I am not sure what needs to be done to make the user see website contents on live server, after i uploaded the code to live server all I see is root directory structure of Symfony, I have gone through How to Deploy a Symfony Application and i am scratching my

Symfony calls the PHP garbage collector on Ubuntu 14.04 even when session.gc_probability is set to 0

那年仲夏 提交于 2019-12-18 10:19:22
问题 As the title state for some reason my Symfony 2.5 Application is calling the php garbage collector even when all of my php.ini files have: session.gc_probability = 0 Does anyone know how to prevent this from happening? Error message im getting: Notice: SessionHandler::gc(): ps_files_cleanup_dir: opendir(/var/lib/php5) failed: Permission denied (13) in /<path-to-my-site>/var/cache/dev/classes.php line 432 FROM PHPINFO(): Directive Local Value Master Value session.gc_divisor 1000 1000 session

Editing form for relationship n:m with extra attributes between two entities

此生再无相见时 提交于 2019-12-13 04:08:20
问题 I have this mapping betwenn two entities: class Orders { // Other attributes /** * @ORM\OneToMany(targetEntity="OrderHasProduct", mappedBy="order") */ protected $orderProducts; // Other set/get methods public function getOrderProducts() { return $this->orderProducts; } } class Product { // Other attributes /** * @ORM\OneToMany(targetEntity="\Tanane\FrontendBundle\Entity\OrderHasProduct", mappedBy="product") */ protected $orderProducts; // Other set/get methods public function getOrderProducts

Handling a complex Symfony2 form with multiple entities relationship

天涯浪子 提交于 2019-12-13 01:43:46
问题 I have a form (still not finished and is missing many fields) that is handled as a wizard with steps, in which fields from multiple entities are handled. This is the form itself: public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add('tipo_tramite', 'entity', array( 'class' => 'ComunBundle:TipoTramite', 'property' => 'nombre', 'required' => TRUE, 'label' => "Tipo de Trámite", 'query_builder' => function (EntityRepository $er) { return $er->createQueryBuilder