本文整理汇总了PHP中FOS\UserBundle\Model\User::serialize方法的典型用法代码示例。如果您正苦于以下问题:PHP User::serialize方法的具体用法?PHP User::serialize怎么用?PHP User::serialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FOS\UserBundle\Model\User
的用法示例。
在下文中一共展示了User::serialize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: serialize
public function serialize()
{
return serialize(array($this->facebookId, parent::serialize()));
}
示例2: serialize
public function serialize()
{
$s = array();
if (method_exists($this, 'serializeFacebook')) {
$s[] = $this->serializeFacebook();
} else {
$s[] = 'no-facebook';
}
if (method_exists($this, 'serializeTwitter')) {
$s[] = $this->serializeTwitter();
} else {
$s[] = 'no-twitter';
}
if (method_exists($this, 'serializeGoogle')) {
$s[] = $this->serializeGoogle();
} else {
$s[] = 'no-google';
}
$s[] = parent::serialize();
return serialize($s);
}
示例3: serialize
/**
* Serializes the user.
*
* The serialized data have to contain the fields used during check for
* changes and the id.
*
* @return string
*/
public function serialize()
{
return serialize(array(parent::serialize(), $this->name, $this->attempts, $this->facebookID, $this->googleID));
}
示例4: serialize
public function serialize()
{
$parent = parent::serialize();
$data = ['parent' => $parent, 'facebookId' => $this->facebookId, 'vkontakteId' => $this->vkontakteId];
return serialize($data);
}