1000 search results

50 lines | src/AppBundle/Form/GenusFormType.php
// ... lines 1 - 6
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
// ... lines 10 - 13
class GenusFormType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('name')
->add('subFamily', EntityType::class, [
// ... lines 21 - 25
])
// ... lines 27 - 28
->add('isPublished', ChoiceType::class, [
// ... lines 30 - 33
])
// ... lines 35 - 39
;
}
// ... lines 42 - 48
}
See Code Block in Script
50 lines | src/AppBundle/Form/GenusFormType.php
// ... lines 1 - 6
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
// ... lines 8 - 13
class GenusFormType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('name')
->add('subFamily', EntityType::class, [
// ... lines 21 - 25
])
// ... lines 27 - 39
;
}
// ... lines 42 - 48
}
See Code Block in Script
50 lines | src/AppBundle/Form/GenusFormType.php
// ... lines 1 - 6
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
// ... lines 8 - 13
class GenusFormType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
// ... line 19
->add('subFamily', EntityType::class, [
'placeholder' => 'Choose a Sub Family',
'class' => SubFamily::class,
'query_builder' => function(SubFamilyRepository $repo) {
return $repo->createAlphabeticalQueryBuilder();
}
])
// ... lines 27 - 39
;
}
// ... lines 42 - 48
}
See Code Block in Script
60 lines | src/AppBundle/Form/GenusFormType.php
// ... lines 1 - 7
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
// ... lines 9 - 16
class GenusFormType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
// ... lines 22 - 44
->add('genusScientists', EntityType::class, [
// ... lines 46 - 48
])
;
}
// ... lines 52 - 58
}
See Code Block in Script
60 lines | src/AppBundle/Form/GenusFormType.php
// ... lines 1 - 7
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
// ... lines 9 - 16
class GenusFormType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
// ... line 22
->add('subFamily', EntityType::class, [
'placeholder' => 'Choose a Sub Family',
'class' => SubFamily::class,
'query_builder' => function(SubFamilyRepository $repo) {
return $repo->createAlphabeticalQueryBuilder();
}
])
// ... lines 30 - 49
;
}
// ... lines 52 - 58
}
See Code Block in Script
60 lines | src/AppBundle/Form/GenusFormType.php
// ... lines 1 - 7
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
// ... lines 9 - 16
class GenusFormType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
// ... lines 22 - 44
->add('genusScientists', EntityType::class, [
'class' => User::class,
'multiple' => true,
'expanded' => true,
])
;
}
// ... lines 52 - 58
}
See Code Block in Script
61 lines | src/AppBundle/Form/GenusFormType.php
// ... lines 1 - 7
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
// ... lines 9 - 16
class GenusFormType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
// ... lines 22 - 44
->add('genusScientists', EntityType::class, [
// ... lines 46 - 48
'choice_label' => 'email',
])
;
}
// ... lines 53 - 59
}
See Code Block in Script
41 lines | src/AppBundle/Form/UserEditForm.php
// ... lines 1 - 6
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
// ... lines 8 - 14
class UserEditForm extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
// ... lines 20 - 24
->add('studiedGenuses', EntityType::class, [
// ... lines 26 - 29
])
;
}
// ... lines 33 - 39
}
See Code Block in Script
41 lines | src/AppBundle/Form/UserEditForm.php
// ... lines 1 - 6
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
// ... lines 8 - 14
class UserEditForm extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
// ... lines 20 - 24
->add('studiedGenuses', EntityType::class, [
'class' => Genus::class,
'multiple' => true,
'expanded' => true,
'choice_label' => 'name',
])
;
}
// ... lines 33 - 39
}
See Code Block in Script
78 lines | src/AppBundle/Entity/GenusScientist.php
// ... lines 1 - 5
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
// ... lines 7 - 8
/**
// ... lines 10 - 11
* @UniqueEntity(
// ... lines 13 - 14
* )
*/
class GenusScientist
{
// ... lines 19 - 77
}
See Code Block in Script
78 lines | src/AppBundle/Entity/GenusScientist.php
// ... lines 1 - 5
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
// ... lines 7 - 8
/**
// ... lines 10 - 11
* @UniqueEntity(
* fields={"genus", "user"},
// ... line 14
* )
*/
class GenusScientist
{
// ... lines 19 - 77
}
See Code Block in Script
78 lines | src/AppBundle/Entity/GenusScientist.php
// ... lines 1 - 5
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
// ... lines 7 - 8
/**
// ... lines 10 - 11
* @UniqueEntity(
* fields={"genus", "user"},
* message="This user is already studying this genus"
* )
*/
class GenusScientist
{
// ... lines 19 - 77
}
See Code Block in Script
79 lines | src/AppBundle/Entity/GenusScientist.php
// ... lines 1 - 5
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
// ... lines 7 - 8
/**
// ... lines 10 - 11
* @UniqueEntity(
* fields={"genus", "user"},
* message="This user is already studying this genus",
* errorPath="user"
* )
*/
class GenusScientist
{
// ... lines 20 - 78
}
See Code Block in Script
33 lines | src/AppBundle/Form/BattleType.php
// ... lines 1 - 5
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
// ... lines 7 - 10
class BattleType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('programmer', EntityType::class, [
'class' => 'AppBundle\Entity\Programmer'
])
// ... lines 19 - 21
;
}
// ... lines 24 - 31
}
See Code Block in Script
teach us how to write correct doctrine dql function please
In recent versions of the Doctrine bundle, you may need to change the below from ```terminal symfony console doctrine:query:sql 'select * from doctrine_migration_versions' ``` to ```terminal symfony console dbal:run-sql 'select * from doctrine_migration_versions' ```
When you do : ``` symfony console doctrine:query:sql 'SELECT * FROM starship WHERE id = 75' ``` I cannt see part_id is 1. Even when I try to do the query myself, I dont see part_id anywhere... Did I miss something?
Hey Cameron, This is actually from doctrine/orm package. This might be an indirect deprecation for other packages that uses doctrine/orm in their dependecies including Foundry like you said. You can just ignore it for now and it should be fixed by package maintainers…
Getting old but while https://github.com/doctrine/migrations/issues/1163 is still a thing; dump-schema does not add FK's. It might be advisable to use `symfony console doctrine:migrations:diff --from-empty-schema` instead of `symfony console doctrine:migrations:dump-schema`.
Hey |mention:75363| , IMO the Doctrine DB prefixes feature is a completely standalone feature that is implemented via an event listener, so in theory yes, you can use that in this case if you need it. Unfortunately, I have never used that personally, so can…