本文整理汇总了PHP中Organization::setCreatedAt方法的典型用法代码示例。如果您正苦于以下问题:PHP Organization::setCreatedAt方法的具体用法?PHP Organization::setCreatedAt怎么用?PHP Organization::setCreatedAt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Organization
的用法示例。
在下文中一共展示了Organization::setCreatedAt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeProcessNewOrgForm
public function executeProcessNewOrgForm(sfWebRequest $request)
{
$f = $request->getParameter("organization");
$p = Doctrine::getTable('Principal')->findOneByFedid($this->getUser()->getUsername());
$o = new Organization();
$o->setName($f["name"]);
$o->setDescription($f["description"]);
$o->setCreatedAt(date('Y-m-d H:i:s'));
$o->save();
$op = new OrganizationPrincipal();
$op->setOrganization($o);
$op->setPrincipal($p);
$op->save();
$i = new Invitation();
$i->setEmail($p->getEmail());
$i->setOrganization($o);
$i->setUuid('1');
$i->setCreatedAt(date('Y-m-d H:i:s'));
$i->setAcceptAt(date('Y-m-d H:i:s'));
$i->setCounter(1);
$i->setInviter($p);
$i->setPrincipal($p);
$i->setStatus("accepted");
$i->save();
$r = new Role();
$r->setName($f["role_name"]);
$r->setOrganization($o);
$r->setShoworder(0);
$r->save();
$o->setDefaultRoleId($r->getId());
$o->save();
$this->redirect("show/index?id=" . $o->getId());
}
示例2: use
// only admins can create orgs
if_is_admin(function () use($app) {
try {
$params = json_decode($app->request()->getBody(), true);
// check if organization id already exists
if (OrganizationQuery::create()->findPk($params['id'])) {
error('id-already-exists', 'Sorry, there is already an organization with that id.');
return;
}
$org = new Organization();
$org->setId(strtolower($params['id']));
$org->setName($params['name']);
if (isset($params['default_theme'])) {
$org->setDefaultTheme($params['default_theme']);
}
$org->setCreatedAt(time());
$org->save();
ok();
} catch (Exception $e) {
error('io-error', $e->getMessage());
}
});
});
/*
* change organization
*/
$app->put('/organizations/:id', function ($org_id) use($app) {
if_is_admin(function () use($app, $org_id) {
$org = OrganizationQuery::create()->findPk($org_id);
if ($org) {
$params = json_decode($app->request()->getBody(), true);