我们在团队中遇到了问题,我们决定检查是否有一种方法或git命令拒绝git push代码中有TODO的地方.有任何想法吗?提前致谢.
我正在尝试使用xdebug和phpstorm调试symfony2应用程序.
我的本地开发环境是Ubuntu 14.04,apache2,Xdebug版本是2.2.7
我有这个工作在另一个PHP(而不是symfony2)项目与以下指南:
https://www.jetbrains.com/phpstorm/help/configuring-xdebug.html
当我执行bookmarlet设置cookie并开始调试这个symfony2项目时,phpstorm检测到传入连接(我接受),但没有其他事情发生.它不会在任何断点处停止.
我有symfony2 phpstorm插件.我试图禁用它,也没有得到任何东西.
这个答案看起来对我很好,但它也没有
我尝试的最后一件事是更改服务器调试配置,禁用路径映射.这样phpstorm开始调试,但它在app_dev.php文件而不是我设置的任何断点中断.
我被困在这里,任何想法都将是appreacite
UPDATE
更多信息我没有提到:
UPDATE
这是我的xdebug配置
[XDebug]
zend_extension="/usr/lib/php5/20121212/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_port="9000"
xdebug.profiler_enable=1
xdebug.profiler_output_dir="<AMP home\tmp>"
Run Code Online (Sandbox Code Playgroud)
我有很多这种类型的关系,但是我看不出为什么这种关系不起作用。
我有一个代表团和一个促进实体:
代表团
晋升
/**
* Company\CBundle\Entity\Promotion
*
* @ORM\Entity
* @DoctrineAssert\UniqueEntity("promotionCode")
*/
class Promotion
{
const REGISTER_DAYS = 30;
const REGISTER_DISCOUNT = 100;
/**
* @var integer $id
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(name="promotionCode", type="string", unique=true, nullable=true)
*/
protected $promotionCode;
/**
* @ORM\Column(name="name", type="string")
*/
protected $name;
/**
* @ORM\Column(name="description", type="string", nullable=true)
*/
protected $description;
/**
* @ORM\Column(name="days", type="integer")
*/
protected $days;
/**
* @ORM\Column(name="discount", type="float")
*/
protected $discount;
/**
* …Run Code Online (Sandbox Code Playgroud) 我有两个DateTimeImmtable对象,期望它们是相同的,我很惊讶地发现它们不是。即,为什么是以下false?
<?php
$d = new \DateTimeImmutable('2018-01-01');
$e = new \DateTimeImmutable('2018-01-01');
var_dump($d === $e);
Run Code Online (Sandbox Code Playgroud)
当然$d == $e评价为true
Doctrine2何时加载ArrayCollection?
直到我调用一个方法,比如count或getValues,我没有数据
这是我的情况.我有一个与促销实体的OneToMany(双向)关系的委托实体,如下所示:
Promotion.php
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
*/
class Promotion
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\ManyToOne(targetEntity="Delegation", inversedBy="promotions", cascade={"persist"})
* @ORM\JoinColumn(name="delegation_id", referencedColumnName="id")
*/
protected $delegation;
}
Run Code Online (Sandbox Code Playgroud)
Delegation.php
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
*/
class Delegation
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\OneToMany(targetEntity="Promotion", mappedBy="delegation", cascade={"all"}, orphanRemoval=true)
*/
public $promotions;
public function __construct() {
$this->promotions = new \Doctrine\Common\Collections\ArrayCollection();
}
}
Run Code Online (Sandbox Code Playgroud)
现在我做类似以下的事情(使用给定的委托)
$promotion …Run Code Online (Sandbox Code Playgroud) collections load lazy-evaluation arraycollection doctrine-orm
我有一个Product与实体有 ManyToMany 关系的实体Category
/**
* @ORM\ManyToMany(targetEntity="App\Domain\Category", inversedBy="stalls")
*/
private $categories;
//...
/**
* @return Collection|Category[]
*/
public function getCategories(): Collection
{
return $this->categories;
}
Run Code Online (Sandbox Code Playgroud)
在ProductCrudController课堂上,我有以下configureFields方法:
public function configureFields(string $pageName): iterable
{
return [
Field::new('name'),
Field::new('description'),
AssociationField::new('categories'),
];
}
Run Code Online (Sandbox Code Playgroud)
在创建/编辑关系中的Product一切都按预期工作时,但在产品列表中,而不是显示相关类别,我看到了产品具有的类别数量。我怎样才能改变这种行为?
在下图中,第一个产品有 1 个类别,列表中的第二个产品有 2 个不同的类别。我希望在此处显示类别的名称。
附带说明:Category类有一个__toString返回类别名称的方法。
编辑:
我正在寻找的行为Tags与下图中的列相同:
symfony ×3
doctrine-orm ×2
php ×2
collections ×1
comparison ×1
easyadmin ×1
equality ×1
git ×1
load ×1
one-to-many ×1
phpstorm ×1
push ×1
todo ×1
xdebug ×1