本文整理汇总了PHP中Tweet::set_publish_at方法的典型用法代码示例。如果您正苦于以下问题:PHP Tweet::set_publish_at方法的具体用法?PHP Tweet::set_publish_at怎么用?PHP Tweet::set_publish_at使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tweet
的用法示例。
在下文中一共展示了Tweet::set_publish_at方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create
public function create()
{
$tweet = new Tweet();
$fromAccount = false;
if ($this->GetData('account_id')) {
$account = TwitterAccount::find_by_id($this->GetData('account_id'));
if ($account) {
$fromAccount = true;
$tweet->twitter_account_id = $account->id;
$tweet->account = $account;
}
}
if ($this->post) {
$tweet->message = $this->PostData('message');
$tweet->set_publish_at($this->PostData('publish_at'));
if ($this->PostData('twitter_account_id')) {
$tweet->twitter_account_id = $this->PostData('twitter_account_id');
}
if ($tweet->save()) {
Site::Flash('notice', 'Your tweet has been added');
if ($fromAccount) {
Redirect("admin/twitter/accounts/{$account->id}/");
} else {
Redirect("admin/twitter/tweets");
}
}
}
if ($fromAccount) {
$this->assign('account', $account);
} else {
$accounts = array();
$allAccounts = TwitterAccount::find_all();
foreach ($allAccounts as $account) {
$accounts[$account->id] = $account->name;
}
$this->assign('accounts', $accounts);
}
$this->assign("tweet", $tweet);
$this->assign("fromAccount", $fromAccount);
$this->title = "Add Tweet";
$this->render("tweet/create.tpl");
}