Skip to content

Instantly share code, notes, and snippets.

View mneuhaus's full-sized avatar

Marc Neuhaus mneuhaus

View GitHub Profile
@mneuhaus
mneuhaus / Entities.md
Created December 3, 2012 14:10
Unique CachIdentifiers for Entities

Given:

$address = new \Address();
$address->zip = 12345;
$repository->add($address);

then the persistenceManager creates a cache entry:

<?php
namespace Community\CacheExtensions\Strategies;
/* *
* This script belongs to the Community.CacheExtensions package. *
* *
* It is free software; you can redistribute it and/or modify it under *
* the terms of the GNU Lesser General Public License, either version 3 *
* of the License, or (at your option) any later version. *
* *
$this->addSql("CREATE TABLE foo_bar_domain_model_branch (persistence_object_identifier VARCHAR(40) NOT NULL, parent_branch_id VARCHAR(40) DEFAULT NULL, name VARCHAR(255) NOT NULL, INDEX IDX_2CF8D4F52D9DE3A7 (parent_branch_id), PRIMARY KEY(persistence_object_identifier)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
$this->addSql("ALTER TABLE foo_bar_domain_model_branch ADD CONSTRAINT FK_2CF8D4F52D9DE3A7 FOREIGN KEY (parent_branch_id) REFERENCES foo_bar_domain_model_branch (persistence_object_identifier)");
/**
* The branch
* @var \Famelo\ADU\Domain\Model\Branch
* @ORM\ManyToOne(inversedBy="sub_branches", cascade={"all"})
* @ORM\JoinColumn(name="parent_branch_id")
* @Flow\Lazy
*/
protected $branch;
/**
@mneuhaus
mneuhaus / Routes.yaml
Last active October 13, 2015 16:28
Flow: Famelo.Navigation Example
-
name: 'Surveys'
uriPattern: 'survey'
navigation: 'Befragungen'
defaults:
'@format': 'html'
'@action': 'index'
'@controller': 'Survey'
'@package': 'Famelo.ADU'
appendExceedingArguments: true
@mneuhaus
mneuhaus / Datenbank.php
Last active December 10, 2015 23:28
WTF: My Personal TheDailyWTF for today. FYI the gibberish is german and 'irgendeinstatement' stands for 'somestatement'
<?php
function irgendeinstatement($sql){
$link = mysql_connect($this->host,$this->user,$this->pw);
if (!$link) {
die('keine Verbindung möglich: ' . mysql_error());
}
mysql_select_db($this->db);
@mneuhaus
mneuhaus / gist:5121381
Created March 8, 2013 23:49
TYPO3: SELECTgetRows
$jobs = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'tx_neulandstellenmarkt_stellen', 'uid=' . intval($job));
T3.Content.UI.Editor.PluginView = T3.Content.UI.Editor.Selectbox.extend({
options: function() {
var that = this;
var options = [], currentValue = this.get('value');
var nodePath = T3.Content.Model.NodeSelection.get('selectedNode').get('nodePath');
$.get('/neos/content/pluginViews?node=' + nodePath, function(result) {
var views = JSON.parse(result);
for (var key in views) {
var view = views[key];
PHPUnit 3.7.9 by Sebastian Bergmann.
Configuration read from /Users/mneuhaus/Sites/Flow/Standalone/Build/buildessentials/PhpUnit/FunctionalTests.xml
I.....F..............
Time: 41 seconds, Memory: 127.75Mb
There was 1 failure:
diff --git a/class.tx_dammam_sync.php b/class.tx_dammam_sync.php
index 86395a6..20917ea 100644
--- a/class.tx_dammam_sync.php
+++ b/class.tx_dammam_sync.php
@@ -508,7 +508,7 @@ class tx_dammam_sync extends tx_scheduler_Task {
'Path' => $subPath,
'Last modification' => date('d.m.y H:i:s', filemtime($subPath)),
'Asset' => isset($this->assetIndex[$subPath]) ? $this->assetIndex[$subPath] : array()
- ));
+ ), 1);