* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
-require_once(t3lib_extMgm::extPath('extbase') . 'Classes/Utility/Strings.php');
-
/**
* Creates a request an dispatches it to the controller which was specified
* by TS Setup, Flexform and returns the content to the v4 framework.
}
}
- // var_dump($persistenceSession);
$persistenceSession->commit();
$persistenceSession->clear();
if (count($response->getAdditionalHeaderData()) > 0) {
*/
public static function autoloadClass($className) {
$classNameParts = explode('_', $className);
- $extensionKey = Tx_Extbase_Utility_Strings::camelCaseToLowerCaseUnderscored($classNameParts[1]);
+ $extensionKey = t3lib_div::camelCaseToLowerCaseUnderscored($classNameParts[1]);
if (t3lib_extMgm::isLoaded($extensionKey)) {
if ($classNameParts[0] === 'ux') {
array_shift($classNameParts);
}
$className = implode('_', $classNameParts);
if (count($classNameParts) > 2 && $classNameParts[0] === 'Tx') {
- $classFilePathAndName = t3lib_extMgm::extPath(Tx_Extbase_Utility_Strings::camelCaseToLowerCaseUnderscored($classNameParts[1])) . 'Classes/';
+ $classFilePathAndName = t3lib_extMgm::extPath(t3lib_div::camelCaseToLowerCaseUnderscored($classNameParts[1])) . 'Classes/';
$classFilePathAndName .= implode(array_slice($classNameParts, 2, -1), '/') . '/';
$classFilePathAndName .= array_pop($classNameParts) . '.php';
}
<?php
/* WE NEED TO DO IT STRTOLOWER */
class tx_Extbase_Persistence_Hook_TCEMainValueObjectUpdater {
+
+ // TODO PHPDoc
public function processDatamap_preProcessFieldArray(&$incomingFieldArray, $table, &$id, $tcemain) {
global $TCA;
if (isset($TCA[$table]['ctrl']['objectType']) && $TCA[$table]['ctrl']['objectType'] === 'ValueObject') {
$id = (int)$uid;
unset($incomingFieldArray['pid']);
}
- //var_dump($incomingFieldArray, $table, $id, $uid);
- //
//$incomingFieldArray['uid'] = $uid;
} else {
// We did not find an already existing entry with the same values in the DB
}
}
+ // TODO PHPDoc
protected function findUid($incomingFieldArray, $table) {
$whereClauseArray = array();
unset($incomingFieldArray['uid']);
*/
public function __call($methodName, $arguments) {
if (substr($methodName, 0, 6) === 'findBy' && strlen($methodName) > 7) {
- $propertyName = Tx_Extbase_Utility_Strings::lowercaseFirst(substr($methodName,6));
+ $propertyName = strtolower(substr(substr($methodName,6),0,1) ) . substr(substr($methodName,6),1);
return $this->findByConditions(array($propertyName => $arguments[0]));
} elseif (substr($methodName, 0, 9) === 'findOneBy' && strlen($methodName) > 10) {
- $propertyName = Tx_Extbase_Utility_Strings::lowercaseFirst(substr($methodName,9));
+ $propertyName = strtolower(substr(substr($methodName,9),0,1) ) . substr(substr($methodName,9),1);
$result = $this->findByConditions(array($propertyName => $arguments[0]), '', '', 1);
if (count($result) > 0) {
return $result[0];
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * A collection of utilities for extensions
- *
- * @package TYPO3
- * @subpackage extbase
- * @version $ID:$
- */
-abstract class Tx_Extbase_Utility_Strings {
-
- /**
- * Returns a given string with underscores as UpperCamelCase (not UTF8 safe)
- *
- * @param string String to be converted to camel case
- * @return string UpperCamelCasedWord
- */
- public static function underscoredToUpperCamelCase($string) {
- $upperCamelCase = str_replace(' ', '', ucwords(str_replace('_', ' ', strtolower($string))));
- return $upperCamelCase;
- }
-
- /**
- * Returns a given string with underscores as lowerCamelCase (not UTF8 safe)
- *
- * @param string String to be converted to camel case
- * @return string lowerCamelCasedWord
- */
- public static function underscoredToLowerCamelCase($string) {
- $upperCamelCase = str_replace(' ', '', ucwords(str_replace('_', ' ', strtolower($string))));
- $lowerCamelCase = strtolower(substr($upperCamelCase,0,1) ) . substr($upperCamelCase,1);
- return $lowerCamelCase;
- }
-
- /**
- * Returns a given CamelCasedString as an lowercase string with underscores (not UTF8 safe)
- *
- * @param string String to be converted to lowercase underscore
- * @return string lowercase_and_underscored_string
- */
- public static function camelCaseToLowerCaseUnderscored($string) {
- return strtolower(preg_replace('/(?<=\w)([A-Z])/', '_\\1', $string));
- }
-
- /**
- * Sets the first char of a string to lowercase (not UTF8 safe)
- *
- * @param string $string
- * @return void
- */
- public static function lowercaseFirst($string) {
- return strtolower(substr($string,0,1) ) . substr($string,1);
- }
-
- /**
- * Returns the extension key. Automatically detects the extension key from the classname.
- *
- * @return string The extension key
- */
- public static function getExtensionKey() {
- // TODO Implement Tx_Extbase_Utility_Strings::getExtensionKey()
- // if(preg_match('/^Tx_([^_]+)/', get_class($this), $matches)) {
- // $possibleExtensionKey = $matches[1];
- // if($possibleExtensionKey != 'lib') {
- // $loadedExtensionKeys = t3lib_div::trimExplode(',', $GLOBALS['TYPO3_CONF_VARS']['EXT']['extList']);
- // foreach($loadedExtensionKeys as $extensionKey) {
- // if($possibleExtensionKey == str_replace('_', '', $extensionKey)) {
- // return $extensionKey;
- // }
- // }
- // }
- // }
- }
-
-}
-?>
\ No newline at end of file