[FLOW3-general] MySQL error

Thomas Layh thomas at layh.com
Tue Nov 16 17:22:45 CET 2010


After adding a matching part everything works fine.

Code looks like:
$result = $query
             ->setLimit($count)
             ->matching($query->logicalNot($query->equals('modified', '')))
             ->setOrderings(array('modified' =>
\F3\FLOW3\Persistence\QueryInterface::ORDER_DESCENDING))
             ->execute();


A similar error was discussed in this issue:
http://forge.typo3.org/issues/6911

Is this the same error or only something similar?

Greetings,
Thomas


On Mon, Nov 1, 2010 at 08:12, Thomas Layh <thomas at layh.com> wrote:

> I have again a small problem with MySql and FLO3. When I try to implement a
> custom find-function in my repository that has as only difference an
> ordering I get the following error:
>
>
> #42S22: SQLSTATE[42S22]: Column not found: 1054 Unknown column
> '_entity.identifier' in 'on clause' (More information)
>
> PDOException thrown in file
> Packages/Framework/FLOW3/Classes/Persistence/Backend/GenericPdo/Backend.php
> in line 762.
>
> I am pretty sure the column exists. The code I am using that is responsible
> for the error looks like:
>
> public function findLatest($count) {
>         $query = $this->createQuery();
>         $result = $query
>                 ->setLimit($count)
>                 ->setOrderings(array('modified' =>
> \F3\FLOW3\Persistence\QueryInterface::ORDER_DESCENDING))
>                 ->execute();
>         return $result->toArray();
>     }
>
> When I remove the setOrderings part everything works fine. I think it looks
> exactly like the example in the blog example.
>
> modified is a DateTime object.
>
> If anyone has a good idea I would be really happy. I think this is
> something really basic and I expected it to work out-of-the-box.
>
> Greetings and thanks in advance.
> Thomas Layh
>


More information about the FLOW3-general mailing list