我使用Symfony 2.3并且我遇到了doctrine / commons 1.2
的问题这是我的代码
$criteria = Criteria::create()
->orderBy(array("createdAt" => Criteria::DESC,'id' => Criteria::DESC))
;
return $this->my_array_collection->matching($criteria);
in doctrine / commons 1.1这是有效的
在教义/公共场合1.2不行不动...... 错误是
语法错误或访问冲突:1064 SQL语法中出错;查看与您的MySQL服务器版本对应的手册...
的更新 的
Entity/Profile.php
/**
*
* @ORM\OneToMany(targetEntity="..\Entity\NotifyBase", mappedBy="dest")
*/
protected $my_array_collection;
Entity/NotifyBase
...
/**
* NotifyBase
*
* @ORM\Table(name="my_table")
* @ORM\InheritanceType("JOINED")
* @ORM\DiscriminatorColumn(name="discr", type="string")
* @ORM\DiscriminatorMap({
* "s" = "..\Entity\notifyS",
* "d" = "..\Entity\notifyD",
* "r" = "..\Entity\notifyR",
* "p" = "..\Entity\notifyP",
* })
* @ORM\Entity(repositoryClass="..\Entity\NotifyBaseRepository")
*/
class NotifyBase
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity="..\Entity\Profile", inversedBy="my_array_collection")
* @ORM\JoinColumn(name="dest_id", referencedColumnName="id")
*/
private $dest;