[
{
"id": 1001,
"priority": "urgent",
"type": "technical",
"status": "new",
"title": "At id quia nesciunt consectetur ad consequatur. Temporibus maxime facere perferendis voluptatem. Eum consequatur libero sed quasi deserunt eos omnis.",
"createdAt": "2019-06-28T23:02:36+03:00",
"updatedAt": null,
"assignedUsers": [
{
"id": 3036,
"ticket": 1001,
"user": {
"id": 106,
"username": "tromp.brandyn",
"password": ")#.4rrhqFQwu8my1",
"roles": [
"ROLE_SUPER_CLIENT"
],
"status": "active",
"firstName": "Lilian",
"lastName": "Will",
"email": "colin.langosh@yahoo.com",
"assignedTickets": [
3036,
{
"id": 3046,
"ticket": {
"id": 1003,
"priority": "urgent",
"type": "other",
"status": "closed",
"title": "Vel id natus sunt aut cum. Aut inventore expedita magnam corporis suscipit. Dolorem aut ut fugiat et sit. Qui eos aliquam sed et ratione. Inventore eos qui doloremque unde qui. Voluptatem nisi nam ut quia corrupti perferendis voluptates aut.",
"createdAt": "2018-04-29T08:29:55+03:00",
"updatedAt": null,
"assignedUsers": [
{
"id": 3042,
"ticket": 1003,
"user": {
"id": 108,
"username": "river04",
"password": "5JQbL5VS52JI}`yb)L{y",
"roles": [
"ROLE_SUPER_CLIENT"
],
"status": "blocked",
"firstName": "Arnaldo",
"lastName": "Homenick",
"email": "abigail91@hotmail.com",
"assignedTickets": [
3042,
{
"id": 3060,
"ticket": {
"id": 1007,
"priority": "major",
"type": "billing",
"status": "new",
"title": "Voluptas et tempore sunt laborum iure expedita quasi nam. Asperiores sint est alias eligendi. Qui eos incidunt dolores dolore adipisci distinctio.",
"createdAt": "2019-06-12T15:40:14+03:00",
"updatedAt": null,
"assignedUsers": [....
2019/12/16 15:38:41 [error] 1259#1259: *134 FastCGI sent in stderr: "PHP message: PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /var/www/new-sys.local/vendor/symfony/serializer/Normalizer/AbstractNormalizer.php on line 184
failed to open stream: Permission denied at /var/www/config-project.local/vendor/monolog/monolog/src/Monolog/Handler/DeduplicationHandler.php:167)"} []
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('type', ChoiceType::class, array(
'choices' => array(
'Select' => '',
'Car' => 'Car',
'User' => 'User'
)
));
$builder->get('type')->addEventListener(
FormEvents::PRE_SET_DATA,
function (FormEvent $event) {
//тут добавляем поля
}
);
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'data_class' => Product::class,
]);
}
{{ form_start(form) }}
<input type="submit">
{{ form_end(form) }}
<script>
$('#add_product_type').change(function () {
let data = {};
data[$(this).attr('name')] = this.value;
let form = $(this).closest('form');
$.ajax({
url: form.attr('action'),
type: form.attr('method'),
data: data,
success: function (data) {
console.log(data);
}
});
});
</script>
{% for key, ping in form.projectPings %}
{{ form_widget(ping.limitFrom) }}
{% endfor %}
public function validateProjectPings($value, ExecutionContextInterface $context)
{
$context->buildViolation('This field cannot be empty.')->addViolation();
}
class Page
{
/**
* @ORM\Id
* @ORM\Column(name="id", type="integer", nullable=false)
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(name="title", type="string", length=64, nullable=false)
*/
private $title;
/**
* @ORM\Column(name="name", type="string", length=255, nullable=false)
*/
private $name;
/**
* Many Pages have Many Roles.
* @ORM\ManyToMany(targetEntity="Role")
* @ORM\JoinTable(name="page_access",
* joinColumns={@ORM\JoinColumn(name="page_id", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="role_id", referencedColumnName="id")}
* )
*/
private $roles;
public function __construct()
{
$this->roles = new ArrayCollection();
}
public function getRoles(): Collection
{
return $this->roles;
}
}
class Role
{
/**
* @ORM\Id()
* @ORM\GeneratedValue(strategy="AUTO")
* @ORM\Column(name="id", type="integer", nullable=false)
*/
private $id;
/**
* @ORM\Column(name="role", type="string", length=45, nullable=false)
*/
private $role;
/**
* Many Users have Many Projects.
* @ORM\ManyToMany(targetEntity="Page")
* @ORM\JoinTable(name="page_access",
* joinColumns={@ORM\JoinColumn(name="role_id", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="page_id", referencedColumnName="id")}
* )
*/
private $pages;
public function __construct()
{
$this->pages = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getRole(): ?string
{
return $this->role;
}
public function setRole(?string $role): self
{
$this->role = $role;
return $this;
}
public function getPages(): Collection
{
return $this->pages;
}
}