This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* ORM CONFIG HERE, LIKE IN SAMPLE BOOTSTRAP */ | |
/** @var $em \Doctrine\ORM\EntityManager */ | |
$em = Doctrine\ORM\EntityManager::create($options, $config); | |
$greeting = new Greeting(); | |
$greeting->setGreeting('Hello World!'); | |
$em->persist($greeting); | |
$greeting2 = new Greeting(); | |
$greeting2->setGreeting('Hello again! This is another greeting!'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace My\Custom\Doctrine2\Function; | |
/** | |
* RandFunction ::= "RAND" "(" ")" | |
*/ | |
class Rand extends FunctionNode | |
{ | |
public function parse(\Doctrine\ORM\Query\Parser $parser) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Application_Model_Resource_Doctrine extends Zend_Application_Resource_ResourceAbstract { | |
/** | |
* | |
* @var \Application_Model_Resource_Doctrine | |
*/ | |
protected static $instance = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Gamempire\Validate\Entity\Field; | |
/** | |
* Validates input entity field to check if it is unique | |
* | |
* @author Ocramius | |
*/ | |
class Unique extends \Zend_Validate_Abstract { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Deneb\Form; | |
/** | |
* Manages scalar fields of an entity | |
*/ | |
class Entity extends ListDecorated { | |
const DEFAULT_DISPLAY_GROUP = 'default'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tested on PHP 5.3.8 on Mac OS 10.6.8. | |
These results are just micro-optimization, which is quite useless, but the foreach construct seems to be always slower than array_search. | |
I expected much better results, but I frankly don't know why I didn't get them this time. Unfortunately I don't have the previous benchmark anymore. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace HelloWorld; | |
use InvalidArgumentException; | |
/** | |
* This class is somewhere in your library | |
* @Entity | |
* @Table(name="users") | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace models; | |
/** | |
* @Entity | |
* @Table(name="workers") | |
* @HasLifecycleCallback | |
*/ | |
class Workers { | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace My\Di\Cache; | |
use Zend\Di\Di as ZendDi; | |
class CompiledDi extends ZendDi { | |
public function get($name, $params = array()) { | |
if($params) { | |
return parent::get($name, $params); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Ocramius\Auth\Storage; | |
use Entity\Ocramius\Admin as AdminEntity, | |
Doctrine\ORM\EntityManager; | |
/** | |
* An @see \Zend_Auth_Storage_Session that handles @see AdminEntity items | |
* @author Marco Pivetta <[email protected]> | |
*/ |
OlderNewer