- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
所以,我对 symfony 还很陌生,但我学得很快...我创建了一个实体和一个临时文件(我忘记了实际上是如何做到的,但它是通过命令行实现的)..
该实体是使用以下内容创建的:
namespace Ecs\CrmBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Ecs\CrmBundle\Entity\TimeClock
*/
class TimeClock
{
/**
* @var integer $id
*/
private $id;
/**
* @var datetime $in1
*/
private $in1;
/**
* @var datetime $out1
*/
private $out1;
/**
* @var datetime $in2
*/
private $in2;
/**
* @var datetime $out2
*/
private $out2;
/**
* @var datetime $in3
*/
private $in3;
/**
* @var datetime $out3
*/
private $out3;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set in1
*
* @param datetime $in1
* @return TimeClock
*/
public function setin1($in1)
{
$this->in1 = $in1;
return $this;
}
/**
* Get in1
*
* @return datetime
*/
public function getin1()
{
return $this->in1;
}
/**
* Set in2
*
* @param datetime $in2
* @return TimeClock
*/
public function setin2($in2)
{
$this->in2 = $in2;
return $this;
}
/**
* Get in2
*
* @return datetime
*/
public function getin2()
{
return $this->in2;
}
/**
* Set in3
*
* @param datetime $in3
* @return TimeClock
*/
public function setin3($in3)
{
$this->in3 = $in3;
return $this;
}
/**
* Get in3
*
* @return datetime
*/
public function getin3()
{
return $this->in3;
}
/**
* Set in4
*
* @param datetime $in4
* @return TimeClock
*/
public function setin4($in4)
{
$this->in4 = $in4;
return $this;
}
/**
* Get in4
*
* @return datetime
*/
public function getin4()
{
return $this->in4;
}
/**
* Set in5
*
* @param datetime $in5
* @return TimeClock
*/
public function setin5($in5)
{
$this->in5 = $in5;
return $this;
}
/**
* Get in5
*
* @return datetime
*/
public function getin5()
{
return $this->in5;
}
/**
* Set in6
*
* @param datetime $in6
* @return TimeClock
*/
public function setin6($in6)
{
$this->in6 = $in6;
return $this;
}
/**
* Get in6
*
* @return datetime
*/
public function getin6()
{
return $this->in6;
}
/**
* @var Ecs\AgentManagerBundle\Entity\User
*/
private $noteBy;
/**
* Set noteBy
*
* @param Ecs\AgentManagerBundle\Entity\User $noteBy
* @return TimeClock
*/
public function setNoteBy(\Ecs\AgentManagerBundle\Entity\User $noteBy = null)
{
$this->noteBy = $noteBy;
return $this;
}
/**
* Get noteBy
*
* @return Ecs\AgentManagerBundle\Entity\User
*/
public function getNoteBy()
{
return $this->noteBy;
}
/**
* @var datetime $in1
*/
private $in1;
/**
* @var datetime $out1
*/
private $out1;
/**
* @var datetime $in2
*/
private $in2;
/**
* @var datetime $out2
*/
private $out2;
/**
* @var datetime $in3
*/
private $in3;
/**
* @var datetime $out3
*/
private $out3;
/**
* @var varchar $totaltime
*/
private $totaltime;
/**
* @var datetime $daydate
*/
private $daydate;
/**
* Set in1
*
* @param datetime $in1
* @return TimeClock
*/
public function setIn1($in1)
{
$this->in1 = $in1;
return $this;
}
/**
* Get in1
*
* @return datetime
*/
public function getIn1()
{
return $this->in1;
}
/**
* Set out1
*
* @param datetime $out1
* @return TimeClock
*/
public function setOut1($out1)
{
$this->out1 = $out1;
return $this;
}
/**
* Get out1
*
* @return datetime
*/
public function getOut1()
{
return $this->out1;
}
/**
* Set in2
*
* @param datetime $in2
* @return TimeClock
*/
public function setIn2($in2)
{
$this->in2 = $in2;
return $this;
}
/**
* Get in2
*
* @return datetime
*/
public function getIn2()
{
return $this->in2;
}
/**
* Set out2
*
* @param datetime $out2
* @return TimeClock
*/
public function setOut2($out2)
{
$this->out2 = $out2;
return $this;
}
/**
* Get out2
*
* @return datetime
*/
public function getOut2()
{
return $this->out2;
}
/**
* Set in3
*
* @param datetime $in3
* @return TimeClock
*/
public function setIn3($in3)
{
$this->in3 = $in3;
return $this;
}
/**
* Get in3
*
* @return datetime
*/
public function getIn3()
{
return $this->in3;
}
/**
* Set out3
*
* @param datetime $out3
* @return TimeClock
*/
public function setOut3($out3)
{
$this->out3 = $out3;
return $this;
}
/**
* Get out3
*
* @return datetime
*/
public function getOut3()
{
return $this->out3;
}
/**
* Set totaltime
*
* @param varchar $totaltime
* @return TimeClock
*/
public function setTotaltime(\varchar $totaltime)
{
$this->totaltime = $totaltime;
return $this;
}
/**
* Get totaltime
*
* @return varchar
*/
public function getTotaltime()
{
return $this->totaltime;
}
/**
* Set daydate
*
* @param datetime $daydate
* @return TimeClock
*/
public function setDaydate($daydate)
{
$this->daydate = $daydate;
return $this;
}
/**
* Get daydate
*
* @return datetime
*/
public function getDaydate()
{
return $this->daydate;
}
}
然后,当我这样做时,我想到了 Doctrine :生成:实体的事情(我可能完全错了——我忘记了我做了什么来创建它)..
它生成一个 timeclock.orm.yml 并在数据库中创建表或类似的东西..
timeclock.orm.yml 有这个:
Ecs\CrmBundle\Entity\TimeClock:
type: entity
table: null
fields:
id:
type: integer
id: true
generator:
strategy: AUTO
in1:
type: datetime
out1:
type: datetime
in2:
type: datetime
out2:
type: datetime
in3:
type: datetime
out3:
type: datetime
totaltime:
type: string
daydate:
type: datetime
manyToOne:
noteBy:
targetEntity: Ecs\AgentManagerBundle\Entity\User
lifecycleCallbacks: { }
问题是,totaltime
,所有in
和out
字段都需要默认为NULL,但我找不到如何做到这一点.. 在我来到这里之前,我一直在寻找过去 30 分钟的时间,试图弄清楚..
然后,一旦我编辑了我需要的任何文件,如何使其也在数据库中更新?
最佳答案
我一直在寻找解决方案,并对已接受的解决方案不满意。[编辑:虽然我现在知道这是因为我使用了注释]。我发现对我有用的方法是设置可为空:
/**
* @ORM\Column(type="varchar", nullable=true)
*/
private $totaltime = null;
关于symfony2 Doctrine 允许空值吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9985531/
我开始从事一个用 Symfony 2.8 编写的大型项目。将整个项目升级到 SF 3 需要数百小时,现在还不可能。我想到了一个想法,将 symfony/symfony 包解压到它替换的单个包中(com
我在提交表单后使用 FOSUserEvents,但订阅者调用了两次。 这样我的验证码第一次有效第二次无效 这是我的代码 router = $router; $this->request
我有以下路线: blog_show: path: /test/123 defaults: { _controller: TotalcanBravofillBundle:Te
我是测试新手。我想测试我的功能。我已经成功安装了 phpUnit。我在互联网上查看了许多教程。但我无法获得有关测试的正确信息。这是我的功能代码: public function loginAction
我正在尝试重现 facebook batch requests 的行为在他们的图形 api 上运行。 所以我认为最简单的解决方案是在 Controller 上向我的应用程序发出几个请求,例如: pub
在 Symfony Progress Bar documentation有一个超酷酒吧的示例图像。不幸的是,看起来文档的其余部分没有解释如何获得这样的结果。 这是图片,以防您错过: 我怎么才能得到它?
我使用Finder发送假脱机电子邮件,但是自动名称生成器将点放在文件名中,有时它们出现在文件的开头。 查找程序似乎无法获取具有该名称的文件-那些文件被隐藏了……有人经历过这种行为吗?有什么建议如何使用
我正在尝试进行 LDAP 身份验证,我目前遇到此类错误: ServiceNotFoundException: The service "security.firewall.map.context.ma
有没有办法验证和检查集合数组是否为空。我已经尝试过: /** * @Assert\NotBlank() * @Assert\Length( min = 1) */ protected $work
使用Smyfony2和Doctrin2,可以使用以下示例创建数据固定装置:http://symfony.com/doc/current/bundles/DoctrineFixturesBundle/i
我看到在大多数Symfony 2示例中,例如,不存在记录时,Symfony 2会引发异常。我认为这种方法对最终用户不友好。为什么有人更喜欢引发异常而不在Flashbag上添加一些错误消息? 最佳答案
我对项目中的以下服务有疑问: app.security.guardAuthenticatorLoginPassword: class: AppBundle\Security\LoginPa
symfony缓存和登录Docker容器存在问题。 Web服务器从www-data用户和组执行,当我使用docker上安装的php从docker容器中清除symfony缓存时,它从root执行。 因此
我想了解 symfony 中的服务 我已阅读http://symfony.com/doc/2.3/book/service_container.html#creating-configuring-se
因为我对 Symfony 和 Doctrine 还很陌生,所以我有一个可能很愚蠢的问题;-) 有人可以用简单的词语向我解释集合(尤其是实体中的ArrayCollections)吗?它是什么以及何时以及
我收到了这个表格: {{ form_start(form) }} {{ form_end(form) }} 我想检查用户是否登录,我这样做了: {% if is_g
我的网站已准备好部署,我正在尝试将其设置为在线。 一些信息: 主持人是 OVH。 它不允许 SSH,我必须使用 FTP 发送文件。也没有命令行。 我现在希望能够在子目录中设置网站:/www/test(
过去几个月以来,我一直在尝试与symfony合作。昨晚我自动删除了不需要的存储库。之后,我无法使用symfony命令创建新的symfony项目。当我在终端中运行Symfony new Security
In the environnement variable, then in system variable, I edited the path and added在环境变量中,然后在系统变量
我们有一个 Symfony 1.4 应用程序,想升级到 Symfony 4。是否有可能或者我们必须重新编程该应用程序? 我们询问了我们附近的一家软件公司,他们告诉我们必须重新编写应用程序。 最佳答案
我是一名优秀的程序员,十分优秀!