Set the url with ?XDEBUG_SESSION_START=PHPSTORM and set a header Cookie: XDEBUG_SESSION=PHPSTORM
{% extends 'form_div_layout.html.twig' %} | |
{% block form_row -%} | |
<div class="row{% if (not compound or force_error|default(false)) and not valid %} has-error{% endif %}"> | |
<div class="input-field col s12"> | |
{{- form_widget(form) -}} | |
{{- form_label(form) -}} | |
{{- form_errors(form) -}} | |
</div> | |
</div> |
COMPOSER_PATH=`which composer` | |
composer() { | |
if ! php5query -s cli -m xdebug >/dev/null; then | |
$COMPOSER_PATH $@ | |
return | |
fi | |
# Re-enable xdebug even after a ctrl-c (SIGINT) | |
# and clear the signal handler | |
trap 'sudo php5enmod xdebug; trap - INT' INT |
/* Sometimes it's pretty easy to run ito troubles with React ES6 components. | |
Consider the following code: */ | |
class EventStub extends Component { | |
componentDidMount() { | |
window.addEventListener('resize', this.onResize.bind(this)); //notice .bind | |
} | |
componentWillUnmount() { | |
window.removeEventListener('resize', this.onResize.bind(this)); |
<?php | |
namespace AppBundle\Form\Type; | |
use AppBundle\Form\DataTransformer\BooleanTypeToBooleanTransformer; | |
use Symfony\Component\Form\AbstractType; | |
use Symfony\Component\Form\FormBuilderInterface; | |
use Symfony\Component\OptionsResolver\OptionsResolver; | |
class BooleanType extends AbstractType |
TLDR: The cascade={"remove"}
is like a "software" onDelete="CASCADE"
, and will remove objects from the database only when an explicit call to $em->remove()
occurs. Thus, it could result in more than one object being deleted. orphanRemoval
can remove objects from the database even if there was no explicit call to ->remove()
.
I answered this question a few times to different people so I will try to sum things up in this Gist.
Let's take two entities A
and B
as an example. I will use a OneToOne relationship in this example but it works exactly the same with OneToMany relationships.
class A
#!/bin/bash | |
# Following the guide found at this page | |
# http://programmingarehard.com/2014/03/17/behat-and-selenium-in-vagrant.html | |
echo "\r\nUpdating system ...\r\n" | |
sudo apt-get update | |
# Create folder to place selenium in |
#!/bin/sh | |
# | |
# Git hook that prevents commits to master | |
# use --no-verify to bypass this hook | |
# ex: git commit -m "init commit" --no-verify | |
branch=`git symbolic-ref HEAD` | |
if [ "$branch" = "refs/heads/master" ]; then | |
echo "Direct commits to the branch master are not allowed" | |
exit 1 |
parameters | |
--level=psr2 --verbose fix $FileDir$/$FileName$ | |
working directory | |
$ProjectFileDir$ |
As William Durand was recently explaining in his SOS, he "didn't see any other interesting blog post about REST with Symfony recently unfortunately". After spending some long hours to implement an API strongly secured with oAuth, I thought it was time for me to purpose my simple explanation of how to do it.
You might have already seen some good explanation of how to easily create a REST API with Symfony2. There are famous really good bundles a.k.a. :