background preloader

Webdesign

Facebook Twitter

Defining Discriminator Maps at Child-level in Doctrine 2.0 | Thoughts of Three. Doctrine ORM 2.0 is a very powerful object-relation mapper for PHP 5.3.0+ which provides us with several powerful features. One of these features is the ability to define mappings using annotations in your model classes. When using inheritance, there are two types, Single Table Inheritance and Class Table Inheritance, for which you need to help Doctrine a little bit by defining the possible subclasses.

For these inheritance types you need to specify a discriminator map using the @DiscriminatorMap annotation, which looks something like this: /** * @Entity * @InheritanceType( "SINGLE_TABLE" ) * @DiscriminatorColumn( name = "discr", type = "string" ) * @DiscriminatorMap( { "person" = "Person", "employee" = "Employee" } ) */ class Person { // Implementation... } /** * @Entity */ class Employee extends Person { // Implementation... } Using such inheritance with a discriminator map introduces the need to update the parent class whenever you create a subclass. Annotations Doctrine Events. When can I use... Support tables for HTML5, CSS3, etc. Javascript SVG et DOM. JavaScript – podstawowe błędy #1. Cześć! 7-9 maja odbędzie się konferencja Front-Trends, którą współorganizuję. Jest to wydarzenie skierowane do front-end developerów, na którym usłyszysz ponad 30 prelekcji specjalistów z całego świata (pracownicy m.in.

Google, W3C, PayPal, The Guardian itd.). Jest to jedna z największych konferencji w Europie – zdecydowanie warto przyjść! Zapraszam! Czasem ludzie pytają mnie – przede wszystkim mailowo – o ocenę ich kodu lub zaproponowanie rozwiązania. W większości podczas analizy problemów przejawia się pewien kanon błędów, jakie popełniają początkujący programiści. New Array czysty tekstvar a = new Array(); // ŹLEvar a = []; // DOBRZE Przykład stary jak świat, ale wart piętnowania. new Array jest wolniejsze (bo wywołujemy konstruktor Array) oraz mniej bezpieczne: czysty tekstvar Array = 1;var a = new Array(); // boom! Function mojaFunkcja () {} czysty tekstfunction zrob () {};function poczekaj () {};function costamInnego () {}; Drugi częsty błąd: czysty tekstvar fn = function foobar () {};

Are My Sites Up? - Simple, easy website uptime and downtime monitoring. Web Fonts. CSS-Tricks.

Browsers