[TYPO3-core] RFC: MM_foreign_select

René Fritz rene at typo3.org
Wed Mar 8 17:08:46 CET 2006


> > +            foreach($tableArr as $foreignTable) {
> > +                $whereArr[] =
> > 'tablenames='.$GLOBALS['TYPO3_DB']->fullQuoteStr($foreignTable,
> > $tableName);
> > +            }
> > +            $where.= ' AND ( '.implode(' OR ', $whereArr).' ) ';
>
> Why do you not use 'WHERE tablenames IN ('table1', 'table2', ...
> 'tablen')'  ?

Yes, could be done.

> > $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', $tableName, $where,
> > '', 'sorting');
>
> The Sorting field should be taken from the TCA of the mm table.

A MM table have no TCA and sorting is just a needed field for MM tables.

> > function writeMM($tableName, $uid, $prependTableName=0)
>
> Please add here the parameter $pid at the end. It is needed to make the
> mm table editable in the backend.
>
> > +        if ($this->MMswapLocalForeign) {
> > +            $uid_foreign = 'uid_local';
> > +            $uid_local = 'uid_foreign';
> > +        } else {
> > +            $uid_local = 'uid_local';
> > +            $uid_foreign = 'uid_foreign';
> > +        }
>
> This codes comes twice. Make a mini function out of it.

I know. But it doesn't hurt.

> > +                $insertFields['sorting'] = $c;
>
> Add the line
>                 if ($pid)    {
>                     $insertFields['pid'] = $pid;
>                 }

??? There's no pid at all

René

-- 
René Fritz
TYPO3 Association - Active Member
http://association.typo3.org/



More information about the TYPO3-team-core mailing list