Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

David Pérez Terol terox

🎯
Focusing
  • Alcoi, Alicante, Spain
  • Twitter @terox
View GitHub Profile
View letterFromNumber.js
function letterFromNumber = function( number ) {
var letter = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.charAt(number % 26)
var concat = Math.round(number / 26);
return concat > 0 ? letterFromNumber(concat-1) + letter : letter;
};
@terox
terox / keybase.md
Last active Aug 29, 2015
keybase.md
View keybase.md

Keybase proof

I hereby claim:

  • I am terox on github.
  • I am terox (https://keybase.io/terox) on keybase.
  • I have a public key whose fingerprint is 5FEF C9A7 B330 C446 3B1E EC15 54D4 46B2 D632 E2ED

To claim this, I am signing this object:

View gist:9cce39ec87306f424743
<?php
/**
* We want "clone/duplicate" -EntityM- keeping fk1 objec and cloning fk2. We are setting fk2 id
* to null ($fk2->setId(null)) to force EntityManger to persist new entity. But didn't work.
* Also doing $fk2 = new EntityB(). We are trying to do it in __clone method following the
* recomendations in Doctrine documentation, and the EntityManager throws something like that:
*
* "Doctrine\ORM\ORMException : Entity of type EntityM has identity through a foreign entity EntityB,
* however this entity has no identity itself.You have to call EntityManager#persist() on the related