Skip to content

Instantly share code, notes, and snippets.

View mneuhaus's full-sized avatar

Marc Neuhaus mneuhaus

View GitHub Profile
@mneuhaus
mneuhaus / Settings.yaml
Created August 5, 2014 14:36
Doctrine/Flow Tenancy Behavior
TYPO3:
Flow:
persistence:
doctrine:
filters:
'SoftDeleteableFilter': 'Famelo\Saas\Domain\Filter\TenancyFilter'
eventListeners:
-
events: ['onFlush']
listener: 'Famelo\Saas\Domain\Listener\TenancyListen
@mneuhaus
mneuhaus / Harvest.md
Last active August 29, 2015 14:04
Harvest Mac App
  1. In the Timesheet window the Right/Left Arrows should switch between the previous/next days
  2. When opening the timesheet window the currently running timer should be focused in order to quickly stop it with "s"
  3. When you start a timer based on an existing timer of a previous day, that timer should be on the current day, not in the past
@mneuhaus
mneuhaus / Foo.md
Last active August 29, 2015 14:04
Extending existing Models/Classes

Flow builds for most classes a proxy for Dependency injection, lazy loading, etc it does this by creating a new file in the Code Cache that contains the contents of the original class appended with the suffix "_Original" and a class with the name of the real className that inherits from that, in this class is some magic for dependency injection, aop and lazy loading. For example:

Given we have a class named \My\Package\Foo
Then Flow will create a file called My_Package_Foo.php
This file contains the code of the class "\My\Package\Foo" with a className suffix "_Original" -> \My\Package\Foo_Original
@mneuhaus
mneuhaus / 1_Lifecycle.md
Last active August 29, 2015 14:03
Expose Usecases

Object Lifecycle

Initialize Object

As a developer i might need to initialize a object before it is used to render a form.

This would be possible to do by overriding the default 'newAction' like this:

MyController.php

/**
<?php
namespace TYPO3\Neos\Taxonomy\Controller\Module\Management;
/* *
* This script belongs to the TYPO3 Flow package "TYPO3.Taxonomy". *
* *
* */
use TYPO3\Flow\Annotations as Flow;
@mneuhaus
mneuhaus / 1_Intro.md
Last active August 29, 2015 14:03
Keep it simple stupid :)

Status of Expose

Currently i'd say that Expose is feature-wise at above 90% complete. There is little to no documentation currently aside from a little demo package i did to test + maintain it. One reason i didn't yet write documentation or shouted out to other people that they should use expose is my feeling, that we took a wrong direction. The introduction of TYPO3.Form and TYPO3.TypoScript added a flexibilty to the whole thing that you can't really find in other "admins". But it adds a huge amount of complexity. After using it extensively for 2 Customer projects this complexity feels plain wrong. It seems the direction expose went, got it to probably 70-80% on a DRY scale, yet we dropped well below 30% on a KISS scale. The performance was an issue as well, which is improved through the TypoScript caching, yet that's one more thing that you need to configure and take care of :/.

Because of this i've h

@mneuhaus
mneuhaus / Foo.php
Last active August 29, 2015 14:02
Using DoctrineExtension Traits
<?php
/**
* A Report
*
* @Flow\Entity
* @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false)
*/
class Foo {
use TimestampableEntity;
use SoftDeleteableEntity;
<?php
namespace Famelo\Saas\Services;
use Famelo\Saas\Core\SaasMatcher;
use Famelo\Saas\Domain\Model\Transaction;
use TYPO3\Eel\Context;
use TYPO3\Flow\Annotations as Flow;
use TYPO3\Flow\Error\Message;
use TYPO3\Flow\Mvc\ActionRequest;
use TYPO3\Flow\Reflection\ObjectAccess;
<?php
/**
* Sets the available packages
*
* @param array $allPackages An array of \TYPO3\Flow\Package\Package objects
* @param array $activePackages An array of \TYPO3\Flow\Package\Package objects
* @return void
*/
public function setPackages(array $allPackages, array $activePackages) {
@fixtures
Scenario: Update existing live node variant in user workspace, publish to live
Given I have the following nodes:
| Identifier | Path | Node Type | Properties | Workspace | Locale |
| fd5ba6e1-4313-b145-1004-dad2f1173a35 | /sites/neosdemotypo3/mainpage | TYPO3.Neos.NodeTypes:Page | {"title": "Mainpage"} | live | mul_ZZ |
| fd5ba6e1-4313-b145-1004-dad2f1173a35 | /sites/neosdemotypo3/mainpage | TYPO3.Neos.NodeTypes:Page | {"title": "Hauptseite"} | live | de_DE |
| 88745891-222b-e9c9-6144-4b3a5d80d482 | /sites/neosdemotypo3/mainpage/subpage | TYPO3.Neos.NodeTypes:Page | {"title": "Subpage"} | live | mul_ZZ |
| 88745891-222b-e9c9-6144-4b3a5d80d482 | /sites/neosdemotypo3/mainpage/subpage | TYPO3.Neos.NodeTypes:Page | {"title": "Unterseite"} | live | de_DE |
And I get a node by path "/sites/neosdemotypo3/mainpage" with the followin