Project

General

Profile

Actions

Feature #56529

closed

support hasProperty and isProperty

Added by Simon Schaufelberger about 10 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
Start date:
2014-03-04
Due date:
% Done:

100%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

The way how you currently check for existence of a value in fluid is not nice.

<f:if condition="{object.hasChildren}">
[...]
</f:if>

results in a method in the Model:

public function getHasChildren()

Instead it should be possible to just write:

public funtion hasChildren()

Same for "is".

Inspired by: https://github.com/czenker/cz_simple_cal/blob/master/Classes/Domain/Model/Base.php

Actions #1

Updated by Simon Schaufelberger about 10 years ago

or is it half implemented here already? at least i found "is" but not "has".

Flow:

\Packages\Framework\TYPO3.Flow\Classes\TYPO3\Flow\Reflection\ObjectAccess.php

CMS:

\typo3\sysext\extbase\Classes\Reflection\ObjectAccess.php

Actions #2

Updated by Simon Schaufelberger about 10 years ago

  • Project changed from 517 to 16
Actions #3

Updated by Gerrit Code Review about 10 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/28036

Actions #4

Updated by Simon Schaufelberger about 10 years ago

ups, now i pushed to TYPO3.CMS. Should i make another patch for TYPO3.Flow or can they both use this ticket?

Actions #5

Updated by Alexander Berl about 10 years ago

The current behaviour is different from what you want to achieve. Currently, when you write "{object.something}" in a Fluid template, it checks if a method "getSomething" or "isSomething" exists in object, and if so calls it.
With your supplied patch, this would only extend to also support "hasSomething", but what you seem to want (correct me if I'm wrong) is to have Fluid also recognize "{object.isSomething}" or "{object.hasSomething}" to call object::isSomething() or object::hasSomething() respectively.

The best way is to push a change for Flow, when it gets merged it will also be backported to TYPO3 CMS anyway, so no need for a seperate changeset (unless you desperately want to speed up the availability in TYPO3 CMS).

Actions #6

Updated by Simon Schaufelberger about 10 years ago

Alexander, yes you got the point. I didn't do a deep test to see what is really going on in ObjectAccess.

Actions #7

Updated by Simon Schaufelberger about 10 years ago

  • Project changed from 16 to 534
Actions #8

Updated by Anja Leichsenring about 10 years ago

this is still in the wrong repository and tracker. Please close this ticket and abandon your patch, both belong to the TYPO3.CMS project and will never reach Flow Fluid. Your ticket needs to go here [http://forge.typo3.org/projects/package-typo3-fluid], and the patch must be pushed to the correct repository.
Check out a local copy of the Packages/TYPO3.Fluid.git repo, apply your patch and push from there. That should give your patch the correct context.

Thanks Anja

Actions #9

Updated by Simon Schaufelberger about 10 years ago

Anja, this patch is NOT about fluid as fluid supports everything already. This patch is about the object access and that is in coded in extbase!

Actions #10

Updated by Alexander Opitz over 9 years ago

  • Project changed from 534 to TYPO3 Core
  • Category set to Extbase
  • Target version set to 7.0
Actions #11

Updated by Mathias Schreiber over 9 years ago

  • Target version changed from 7.0 to 7.1 (Cleanup)
Actions #12

Updated by Gerrit Code Review over 9 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/28036

Actions #13

Updated by Gerrit Code Review about 9 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/28036

Actions #14

Updated by Simon Schaufelberger about 9 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #15

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF