Skip to content

Instantly share code, notes, and snippets.

View bramstroker's full-sized avatar

Bram Gerritsen bramstroker

View GitHub Profile
var self = this;
$.each(this.filters, function(index, filter) {
filter.label = (self.labels[filter.field] && self.labels[filter.field][filter.value]) ?
self.labels[filter.field][filter.value] :
filter.value;
AjaxSolr.theme(
'activeFilterListItem',
filter,
function() {
<?php
$class = Mockery::mock('Doctrine\ORM\ClassMetadata');
include '/mypath/doctrine/orm/lib/Doctrine/ORM/Query.php';
?>
Now I get the following error message:
Fatal error: Cannot use Doctrine\ORM\Mapping\ClassMetadata as ClassMetadata because the name is already in use in Query.php on line 29
This line contains a namespace import:
protected function validateLocalPart()
{
// First try to match the local part on the common dot-atom format
$result = false;
// Dot-atom characters are: 1*atext *("." 1*atext)
// atext: ALPHA / DIGIT / and "!", "#", "$", "%", "&", "'", "*",
// "+", "-", "/", "=", "?", "^", "_", "`", "{", "|", "}", "~"
$atext = 'a-zA-Z0-9\x21\x23\x24\x25\x26\x27\x2a\x2b\x2d\x2f\x3d\x3f\x5e\x5f\x60\x7b\x7c\x7d\x7e';
if (preg_match('/^[' . $atext . ']+(\x2e+[' . $atext . ']+)*$/', $this->localPart)) {
@bramstroker
bramstroker / BarTrait
Created October 9, 2014 08:21
Unterminated comment MethodReflection
<?php
/**
* BarTrait
*
* @category MyNamespace
* @package MyNamespace
* @copyright 2014
* @version SVN: $Id$
*/
<?php
namespace Module\Entity;
/**
* @ORM\Entity
*/
class EntityA
{
/**
* @ORM\ManyToOne(targetEntity="Module\Entity\EntityBInterface", fetch="LAZY")
Fatal error: Uncaught exception 'Doctrine\Common\Persistence\Mapping\MappingException' with message 'The class 'AcsiMarketingPackage\Entity\Package' was not found in the chain configured namespaces AcsiBase\Entity, AcsiDoctrine\Entity, AcsiI18n\Entity, AcsiCRM\Entity, AcsiMedia\Entity, AcsiGeo\Entity, AcsiCampsite\Entity, AcsiWebsite\Entity, AcsiCpc\Entity, AcsiCampsiteWeather\Entity, AcsiCampsiteReview\Entity, AcsiCampsiteInfoRequest\Entity, AcsiRedirect\Entity, AcsiMatch2Camp\Entity, AcsiPortal\Entity, AcsiAppCodeRedirect\Entity, AcsiCmsUser\Entity' in C:\www\campingcard\vendor\doctrine\common\lib\Doctrine\Common\Persistence\Mapping\MappingException.php on line 37
Doctrine\Common\Persistence\Mapping\MappingException: The class 'AcsiMarketingPackage\Entity\Package' was not found in the chain configured namespaces AcsiBase\Entity, AcsiDoctrine\Entity, AcsiI18n\Entity, AcsiCRM\Entity, AcsiMedia\Entity, AcsiGeo\Entity, AcsiCampsite\Entity, AcsiWebsite\Entity, AcsiCpc\Entity, AcsiCampsiteWeather\Entity, AcsiCam
$campsite = $campsiteRepo->find(100011);
$ranking = $campsite->getRanking();
$ranking = $rankingRepo->findOneBy(['campsite' => 100011]);
$campsite = $ranking->getCampsite();
class MyResource extends AbstractResourceListener implements ResourceInterface
{
public function fetch($id)
{
$entity = $this->getEntityById($id, false);
if ($entity === null) {
return new ApiProblemResponse(new ApiProblem(404, 'Entity with ID ' . $id . ' not found'));
}
return $entity;
//Dit werkt wel
$('#js-searchresults-change-data').on('click', function() {
// Append a overlay for the form
$('#main').append('<div id="js-searchresults-form-overlay" class="searchresults-overlay searchresults-overlay--form"></div>');
$('#js-searchresults-form, #js-searchresults-form-overlay').velocity('fadeIn', {duration: 300});
})
//Dit werkt niet
/*$(document).on('click', '#js-searchresults-change-data', function (event) {
Mockery::on(function($a, $b) {
$this->assertEquals('foo', $a);
return true;
});