Skip to content

Instantly share code, notes, and snippets.

@Skyl0
Skyl0 / gist:4ed5d8173365a486d36b
Created March 17, 2015 12:28
Problems with JOIN
$query = $GLOBALS["TYPO3_DB"]->exec_SELECTquery(
'tx_y7fahrzeugdatenbank_domain_model_fahrzeug.uid, tx_y7fahrzeugdatenbank_domain_model_fahrzeug.name, tx_y7fahrzeugdatenbank_domain_model_fahrzeug.beschreibung, news_uid, fahrzeug_uid', // SELECT
'tx_y7fahrzeugdatenbank_domain_model_fznewsrel JOIN tx_y7fahrzeugdatenbank_domain_model_fahrzeug ON tx_y7fahrzeugdatenbank_domain_model_fznewsrel.fahrzeug_uid = tx_y7fahrzeugdatenbank_domain_model_fahrzeug.uid', // FROM
'news_uid = 7' /*. $row['uid']*/, //WHERE
'', //GROUPBY
'', //ORDERBY
'', //LIMIT
'' //uidIndexField
);
$res = $GLOBALS['TYPO3_DB']->sql_fetch_assoc( $query );
@Skyl0
Skyl0 / ext_tables.php
Created March 19, 2015 09:38
Fields don't show while editing/create News
$tempColumns = array (
"is_operation" => array (
"exclude" => 0,
"label" => "Ist Einsatz?",
"config" => Array (
"type" => "check",
)
),
"participating_vehicles" => array (
"exclude" => 0,
@Skyl0
Skyl0 / ext_tables.sql
Created March 19, 2015 09:53
Underlying Structure for ext_tables.php
#
# Table structure for table 'tt_news'
#
CREATE TABLE tt_news (
is_operation tinyint(1) unsigned DEFAULT '0' NOT NULL,
participating_vehicles int(11) unsigned DEFAULT '0' NOT NULL,
);
@Skyl0
Skyl0 / TypoBE.output
Created March 19, 2015 10:53
MM relations
caller TYPO3\CMS\Core\Database\DatabaseConnection::exec_SELECTquery
ERROR Unknown column 'sorting_foreign' in 'order clause'
lastBuiltQuery SELECT * FROM tx_y7fahrzeugdatenbank_domain_model_mm WHERE uid_foreign=7 AND local_uid='tx_y7fahrzeugdatenbank_domain_model_fahrzeug.uid' AND foreign_uid='tt_news.uid' ORDER BY sorting_foreign
debug_backtrace TYPO3\CMS\Backend\Controller\EditDocumentController->main#40 // TYPO3\CMS\Backend\Controller\EditDocumentController->makeEditForm#698 // TYPO3\CMS\Backend\Form\DataPreprocessor->fetchRecord#865 // TYPO3\CMS\Backend\Form\DataPreprocessor->renderRecord#168 // TYPO3\CMS\Backend\Form\DataPreprocessor->renderRecordRaw#214 // TYPO3\CMS\Backend\Form\DataPreprocessor->renderRecord_SW#264 // TYPO3\CMS\Backend\Form\DataPreprocessor->renderRecord_selectProc#300 // TYPO3\CMS\Backend\Form\DataPreprocessor->selectAddForeign#404 // TYPO3\CMS\Backend\Form\DataPreprocessor->getDataIdList#774 // TYPO3\CMS\Core\Database\RelationHandler->start#817 // TYPO3\CMS\Core\Database\Relation
@Skyl0
Skyl0 / ext_tables.php
Created March 19, 2015 10:57
Updated MM relational database
$tempColumns = array (
"is_operation" => array (
"exclude" => 0,
"label" => "Ist Einsatz?",
"config" => Array (
"type" => "check",
)
),
"participating_vehicles" => array (
@Skyl0
Skyl0 / ext_tables.php
Created March 19, 2015 11:40
1..N beziehung
$tempColumns = array (
"is_operation" => array (
"exclude" => 0,
"label" => "Ist Einsatz?",
"config" => Array (
"type" => "check",
)
),
"participating_vehicles" => array (
@Skyl0
Skyl0 / ext_tables.php
Created March 19, 2015 12:39
TCA FUN
$tempColumns = array (
"is_operation" => array (
"exclude" => 0,
"label" => "Ist Einsatz?",
"config" => Array (
"type" => "check",
)
),
"participating_vehicles" => array (
"exclude" => 0,
@Skyl0
Skyl0 / FzKategorieController.php
Created March 24, 2015 12:14
Extending Controller
<?php
namespace Y7group\Y7Fahrzeugdatenbank\Controller;
/***************************************************************
*
* Copyright notice
*
* (c) 2015 Marc Ernst <ernst.marc@gmail.com>, Y7 group
*
@Skyl0
Skyl0 / Fahrzeug.php
Created March 24, 2015 12:21
Fahrzeug Class Model
<?php
namespace Y7group\Y7Fahrzeugdatenbank\Domain\Model;
/**
* Fahrzeug
*/
class Fahrzeug extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
/**
* name
@Skyl0
Skyl0 / Controller.php
Created March 24, 2015 15:28
Controller Problems
<?php
namespace Y7group\Y7Fahrzeugdatenbank\Controller;
/**
* FahrzeugController
*/
class FahrzeugController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
/**
* fahrzeugRepository
*