
Bonne année !
Toute l'équipe de KNP est heureuse de vous souhaiter une excellente année 2011, pleine de Symfony2, de Textmate2, de Zend2… Read more
Toute l'équipe de KNP est heureuse de vous souhaiter une excellente année 2011, pleine de Symfony2, de Textmate2, de Zend2… Read more
Knp wishes you a happy new year! Read more
Two months ago, we announced a big news: that our friday afternoons would be dedicated to R&D. I was very happy to see a lot of interest from our team as well as the community. But what now? Read more
This is one of these news that makes us really really happy… We're absolutely delighted to announce that Vincent Jousse will join KNP as its new Chief Technology Officer on January 5th, 2011. Read more
Le 4 mai 2010, KNP déposait la première brique du DoctrineUserBundle, aujourd'hui renommé UserBundle. Le but : un équivalent du sfGuardPlugin… en Symfony2 et Doctrine2. Aujourd'hui… Read more
As part of our new KNP Initiatives, we are starting BusinessTime, a new web application that will allow us to manage our projects and contacts… in Rails 3! Read more
Lorsqu'un Schtroumpf est supprimé ou que son image est modifiée, il faut que nous supprimions son ancienne image. Pour ce faire, nous allons exploiter les méthodes postUpdate et postDelete de la classe Doctrine_Record dont hérite notre Schtroumpf'modèle. // lib/model/doctrine/Schtroumpf.class.php class Schtroumpf extends BaseSchtroumpf { // ... /** * Gets the path of the picture * * @param string $filename Picture filename (null to use the current value) * * @return string or null if the filename is empty */ public function getPicturePath($filename = null) { if (null === $filename) { $filename = $this->picture; } if (empty($filename)) { return null; } return $this->picture_directory_path . DIRECTORY_SEPARATOR . $filename; } public function postUpdate(Doctrine_Event $event) { $modified = $event->getInvoker()->getModified(true); if (array_key_exists($field, $modified) && !empty($modified[$field]) && $modified[$field] != $event->getInvoker()->getPicture() ) { @unlink($event->getInvoker()->getPicturePath($modified[$field])); } } public function postDelete(Doctrine_Event $event) { foreach ( $this->_options as $field => $params ) { if (null !== $path = $event->getInvoker()->getPicturePath()) { @unlink($path); } } } } Le mot de la fin Read more