This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ErrorException: | |
Warning: spl_object_hash() expects parameter 1 to be object, string given | |
at vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1687 | |
at Doctrine\ORM\UnitOfWork->doPersist('df', array('00000000250caa62000000001483bbd7' => object(Tricks), '00000000250ca945000000001483bbd7' => object(Groupe))) | |
(vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:2269) | |
at Doctrine\ORM\UnitOfWork->cascadePersist(object(Tricks), array('00000000250caa62000000001483bbd7' => object(Tricks), '00000000250ca945000000001483bbd7' => object(Groupe))) | |
(vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1731) | |
at Doctrine\ORM\UnitOfWork->doPersist(object(Tricks), array('00000000250caa62000000001483bbd7' => object(Tricks), '00000000250ca945000000001483bbd7' => object(Groupe))) | |
(vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1668) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Entité Video | |
<?php | |
namespace App\Entity; | |
class Video | |
{ | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// VideoAddType | |
class VideoAddType extends AbstractType | |
{ | |
public function buildForm(FormBuilderInterface $builder, array $options) | |
{ | |
$builder | |
->add('alt', TextType::class) | |
->add('url', TextType::class,array('data_class'=> Video::class, | |
'label'=>'Url de la vidéo', | |
)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UpdateTrickController extends Controller | |
{ | |
public function __invoke($id, Request $request) | |
{ | |
// On récupère le trick à modifier | |
$updateTrick = $this->getDoctrine() | |
->getManager() | |
->getRepository('App:Tricks') | |
->find($id); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// UpdateTrickController | |
class UpdateTrickController extends Controller | |
{ | |
public function __invoke($id, Request $request) | |
{ | |
// On récupère le trick à modifier | |
$updateTrick = $this->getDoctrine() | |
->getManager() | |
->getRepository('App:Tricks') | |
->find($id); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function buildForm(FormBuilderInterface $builder, array $options) | |
{ | |
$builder | |
->add('nom', TextType::class) | |
->add('description', TextareaType::class) | |
->add('image', CollectionType::class, array( | |
'entry_type' => ImageAddType::class, | |
'entry_options' => array('data_class' => Image::class, 'label' => false), | |
'allow_add' => true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Ma vue update Trick | |
<div class="container-fluid"> | |
<div class="row well"> | |
<div class="form-group col-md-8"> | |
{{ form_start(form) }} | |
<h3>Modifier le nom:</h3> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container-fluid"> | |
<div class="row well"> | |
<div class="form-group col-md-8"> | |
{{ form_start(form) }} | |
<h3>Modifier le nom:</h3> | |
{{ form_widget(form.nom, {'attr': {'class': 'form-control'}}) }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UpdateTrickController extends Controller | |
{ | |
public function __invoke($id, Request $request) | |
{ | |
// On récupère le trick à modifier | |
$updateTrick = $this->getDoctrine() | |
->getManager() | |
->getRepository('App:Tricks') | |
->find($id); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Event | |
namespace App\Service; | |
use App\Entity\Video; | |
use Symfony\Component\EventDispatcher\Event; | |
class VideoChangementEvent extends Event | |
{ | |
const NAME = 'video.validated_upload'; |