Skip to content

Instantly share code, notes, and snippets.

View thewholelifetolearn's full-sized avatar

Ralph KEMPS thewholelifetolearn

View GitHub Profile
@thewholelifetolearn
thewholelifetolearn / update_series_claim.sh
Last active April 21, 2020 20:05
Bash script to update a series claim in Inventaire.io
#!/bin/bash
#
# Update series of some works
# Move works from series to another
set -o errexit
set -o nounset
set -o pipefail
HOST="https://inventaire.io"
@thewholelifetolearn
thewholelifetolearn / Book.orm.xml
Created April 25, 2013 18:43
This configuration of files shows an error: cvc-complex-type.2.4.b: The content of element 'association-overrides' is not complete. One of '{"http://doctrine-project.org/schemas/orm/doctrine-mapping":association-override, WC[##other:"http://doctrine-project.org/schemas/orm/doctrine-mapping"]}' is expected.
<?xml version="1.0" encoding="UTF-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
https://raw.github.com/doctrine/doctrine2/master/doctrine-mapping.xsd">
<mapped-superclass name="SocialLibrary\ReadBundle\Entity\Book">
<id name="id" type="integer">
<generator strategy="AUTO" />
</id>
@thewholelifetolearn
thewholelifetolearn / Controller.php
Created January 14, 2013 13:15
[HowTo] Use SonataMediaBundle Small example of how to save a media with SonataMediaBundle in a "normal" controller.
public function createAction(Request $request)
{
if (false === $this->get('security.context')->isGranted('ROLE_USER')) {
throw new AccessDeniedException();
}
$entity = new Manga();
$form = $this->createForm(new MangaType(), $entity);
$form->bind($request);
$entity->addOwner($this->get('security.context')->getToken()->getUser());