本文整理汇总了PHP中self::setContent方法的典型用法代码示例。如果您正苦于以下问题:PHP self::setContent方法的具体用法?PHP self::setContent怎么用?PHP self::setContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类self
的用法示例。
在下文中一共展示了self::setContent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fromBaseToken
public static function fromBaseToken(BaseToken $token)
{
$extended = new self($token->getPrototype());
if ($token->isChanged()) {
$extended->setContent('__CHANGE_HOLDER__' . $token->getContent());
$extended->setContent($token->getContent());
}
return $extended;
}
示例2: getRepliesOfTicket
/**
* return all replies on a specific ticket.
* @param $ticket_id the id of the ticket of which we want the replies.
* @param $view_as_admin if the browsing user is an admin/mod it should be 1, this will also show the hidden replies.
* @return an array with ticket_reply objects (beware the author and content are objects on their own, not integers!)
*/
public static function getRepliesOfTicket($ticket_id, $view_as_admin)
{
$dbl = new DBLayer("lib");
$statement = $dbl->execute("SELECT * FROM ticket_reply INNER JOIN ticket_content INNER JOIN ticket_user ON ticket_reply.Content = ticket_content.TContentId and ticket_reply.Ticket=:id and ticket_user.TUserId = ticket_reply.Author ORDER BY ticket_reply.TReplyId ASC", array('id' => $ticket_id));
$row = $statement->fetchAll();
$result = array();
foreach ($row as $tReply) {
//only add hidden replies if the user is a mod/admin
if (!$tReply['Hidden'] || $view_as_admin) {
//load author
$instanceAuthor = Ticket_User::constr_TUserId($tReply['Author']);
$instanceAuthor->setExternId($tReply['ExternId']);
$instanceAuthor->setPermission($tReply['Permission']);
//load content
$instanceContent = new Ticket_Content();
$instanceContent->setTContentId($tReply['TContentId']);
$instanceContent->setContent($tReply['Content']);
//load reply and add the author and content object in it.
$instanceReply = new self();
$instanceReply->setTReplyId($tReply['TReplyId']);
$instanceReply->setTimestamp($tReply['Timestamp']);
$instanceReply->setAuthor($instanceAuthor);
$instanceReply->setTicket($ticket_id);
$instanceReply->setContent($instanceContent);
$instanceReply->setHidden($tReply['Hidden']);
$result[] = $instanceReply;
}
}
return $result;
}
示例3: create
public static function create($data, $obj = null)
{
$obj = new self();
$options = json_decode($data['options'], true);
$fblikeOptions = $options['fblikeOptions'];
$obj->setFblikeOptions($fblikeOptions);
$obj->setContent($data['fblike']);
return parent::create($data, $obj);
}
示例4: createFromArray
public static function createFromArray($input)
{
if (false == isset($input['filename']) || false == isset($input['content'])) {
throw new \InvalidArgumentException('Not all required fields exists in array.');
}
$dto = new self();
$dto->setFilename($input['filename']);
$dto->setContent($input['content']);
return $dto;
}
示例5: create
/**
* @param Title $title
* @param PostRevision $post
* @param User $user
* @param string $content
* @param string $format wikitext|html
* @param string $changeType
* @return PostSummary
*/
public static function create(Title $title, PostRevision $post, User $user, $content, $format, $changeType)
{
$obj = new self();
$obj->revId = UUID::create();
$obj->user = UserTuple::newFromUser($user);
$obj->prevRevision = null;
$obj->changeType = $changeType;
$obj->summaryTargetId = $post->getPostId();
$obj->setContent($content, $format, $title);
return $obj;
}
示例6: create
/**
* @param Workflow $workflow
* @param User $user
* @param string $content
* @param string $format wikitext|html
* @param string[optional] $changeType
* @return Header
*/
public static function create(Workflow $workflow, User $user, $content, $format, $changeType = 'create-header')
{
$obj = new self();
$obj->revId = UUID::create();
$obj->workflowId = $workflow->getId();
$obj->user = UserTuple::newFromUser($user);
$obj->prevRevision = null;
// no prior revision
$obj->setContent($content, $format, $workflow->getArticleTitle());
$obj->changeType = $changeType;
return $obj;
}
示例7: make
/**
* @author WN
* @param string|null $content
* @param int|null $color
* @param int|null $option
* @param int|null $bgcolor
* @return Char
*/
public static function make($content = null, $color = null, $option = null, $bgcolor = null, $default = null)
{
$obj = new self($content);
if ($content !== null) {
$obj->setContent($content);
}
if ($color !== null) {
$obj->setColor($color);
}
if ($bgcolor !== null) {
$obj->setBgcolor($bgcolor);
}
$obj->setDefault($default);
return $obj;
}
示例8: duplicate
/**
* {@inheritdoc}
*/
public function duplicate($name)
{
$clone = new self($name);
$clone->setContent($this->content);
$clone->setChecksum($this->checksum);
$clone->setMetadata($this->metadata);
$clone->setMimeType($this->mimetype);
$clone->setSize($this->size);
if (null !== $this->lastAccess) {
$clone->setLastAccess($this->lastAccess);
}
if (null !== $this->lastModification) {
$clone->setLastModification($this->lastModification);
}
return $clone;
}
示例9: byPath
public static function byPath($_pathfile)
{
if (!file_exists($_pathfile)) {
throw new Exception('Chemin jusqu\'au widget non trouvé : ' . $_pathfile);
}
$path_parts = pathinfo($_pathfile);
$informations = explode('.', $path_parts['basename']);
$widget = new self();
$widget->setType($informations[1]);
$widget->setSubtype($informations[2]);
$widget->setName($informations[3]);
$folder = explode('/', $path_parts['dirname']);
$widget->setVersion($folder[count($folder) - 1]);
$widget->setContent(file_get_contents($_pathfile));
$widget->setPath($_pathfile);
return $widget;
}
示例10: instanceFromAssocArray
/**
* @param array $arr
* @return RiakBlogPost|null
*/
public static function instanceFromAssocArray($arr)
{
if ($arr !== null) {
$instance = new self();
$instance->identifier = $arr[static::$IDENTIFIER_NAME];
$instance->setAuthorIdentifier($arr[static::$AUTHOR_ID_NAME]);
$instance->setAuthorDisplayName($arr[static::$AUTHOR_DISP_NAME]);
$instance->postedDate = Carbon::createFromFormat(\DateTime::ISO8601, $arr[static::$POST_DATE_NAME]);
$instance->lastModifiedDate = Carbon::createFromFormat(\DateTime::ISO8601, $arr[static::$MODIFIED_DATE_NAME]);
$instance->setTitle(isset($arr[static::$TITLE_NAME]) ? $arr[static::$TITLE_NAME] : "");
$instance->setContent($arr[static::$CONTENT_NAME]);
if ($arr[static::$PUBLISHED_NAME] == '1') {
$instance->setIsPublished(true);
} else {
$instance->setIsPublished(false);
}
return $instance;
}
}
示例11: fromArray
/**
* {@inheritdoc}
*/
public static function fromArray(array $values)
{
$message = new self();
$values = array_merge(['name' => null, 'insertion_point' => null, 'content' => null], $values);
$message->setName($values['name']);
$message->setInsertionPoint($values['insertion_point']);
$message->setContent($values['content']);
return $message;
}
示例12: create
/**
* @param string $title
* @param string $content
* @return Post
*/
public static function create($title, $content)
{
$post = new self($postId = PostId::generate());
$post->setTitle($title);
$post->setContent($content);
$post->setPublishingDate($publishingDate = new \DateTime());
$post->recordThat(new PostWasPublished($postId, $title, $content, $publishingDate));
return $post;
}
示例13: create
public static function create($data, $obj = null)
{
$obj = new self();
$obj->setContent($data['html']);
return parent::create($data, $obj);
}
示例14: create
/**
* @param PostId $postId
* @param string $author
* @param string $content
* @return Comment
*/
public static function create(PostId $postId, $author, $content)
{
$comment = new self($commentId = CommentId::generate());
$comment->setPostId($postId);
$comment->setAuthor($author);
$comment->setContent($content);
$comment->setCreatingDate($creatingDate = new \DateTime());
$comment->recordThat(new CommentWasAdded($commentId, $postId, $author, $content, $creatingDate));
return $comment;
}
示例15: GetListExt
//.........这里部分代码省略.........
$tmpPoint['image_mm'] = $multimedia_link;
$tmp_image = new Geo_Multimedia($multimedia_spec);
if ($tmp_image) {
$tmpPoint['image_src'] = $tmp_image->getSrc();
$tmpPoint['image_width'] = $tmp_image->getWidth();
$tmpPoint['image_height'] = $tmp_image->getHeight();
}
}
$tmpPoint['video_mm'] = 0;
$tmpPoint['video_id'] = '';
$tmpPoint['video_type'] = '';
$tmpPoint['video_width'] = '';
$tmpPoint['video_height'] = '';
if ($row['video_mm']) {
$multimedia_spec = $row['video_mm'];
$multimedia_link = $multimedia_spec;
// the dynamic maps (i.e. with mc_mapCons) have grouping by multimedia,
// while article maps have all multimedia separated (and read with concat)
if (!$mc_mapCons) {
$multimedia_spec_arr = explode('-', $multimedia_spec);
if (2 == count($multimedia_spec_arr)) {
$multimedia_spec = 0 + $multimedia_spec_arr[0];
$multimedia_link = 0 + $multimedia_spec_arr[1];
}
}
$tmpPoint['video_mm'] = $multimedia_link;
$tmp_video = new Geo_Multimedia($multimedia_spec);
if ($tmp_video) {
$tmpPoint['video_id'] = $tmp_video->getSrc();
$tmpPoint['video_type'] = $tmp_video->getSpec();
$tmpPoint['video_width'] = $tmp_video->getWidth();
$tmpPoint['video_height'] = $tmp_video->getHeight();
}
}
if ($tmp_image || $tmp_video) {
$mm_objs[$row['ml_id']] = array('image' => $tmp_image, 'video' => $tmp_video);
}
// for the list-of-objects array
$tmpPoint['map_id'] = $ps_mapId;
$tmpPoint['art_number'] = 0;
$tmpPoint['art_numbers'] = '';
if ($mc_mapCons) {
$tmpPoint['map_id'] = $row['m_id'];
$tmpPoint['art_number'] = $row['art_number'];
$tmpPoint['art_numbers'] = $row['art_numbers'];
}
$tmpPoint['geo_id'] = $row['loc_id'];
$tmpPoint['geo_type'] = $row['poi_type'];
$tmpPoint['geo_style'] = $row['poi_type_style'];
$tmpPoint['geo_radius'] = $row['l_radius'];
$tmpPoint['geo_user'] = $row['l_user'];
$tmpPoint['geo_updated'] = $row['l_updated'];
$tmpPoint['txt_id'] = $row['con_id'];
$tmpPoint['txt_user'] = $row['c_user'];
$tmpPoint['txt_updated'] = $row['c_updated'];
$dataArray[] = $tmpPoint;
}
}
if (0 == count($dataArray)) {
return array();
}
$dataArray_tmp = $dataArray;
$objsArray = array();
$dataArray = array();
foreach ($dataArray_tmp as $one_poi) {
$one_poi_source = array('id' => $one_poi['loc_id'], 'fk_map_id' => $one_poi['map_id'], 'fk_location_id' => $one_poi['geo_id'], 'poi_style' => $one_poi['style'], 'rank' => $one_poi['rank']);
$one_poi_obj = new self($one_poi_source, true);
$one_geo_source = array('poi_location' => null, 'poi_type' => $one_poi['geo_type'], 'poi_type_style' => $one_poi['geo_style'], 'poi_center' => null, 'poi_radius' => $one_poi['geo_radius'], 'IdUser' => $one_poi['geo_user'], 'time_updated' => $one_poi['geo_updated'], 'latitude' => $one_poi['latitude'], 'longitude' => $one_poi['longitude']);
$one_poi_obj->location = new Geo_Location($one_geo_source, true);
$one_lan_source = array('id' => $one_poi['con_id'], 'fk_maplocation_id' => $one_poi['loc_id'], 'fk_language_id' => $ps_languageId, 'fk_content_id' => $one_poi['txt_id'], 'poi_display' => $one_poi['display']);
$one_poi_obj->setLanguage($ps_languageId, new Geo_MapLocationLanguage(NULL, 0, $one_lan_source, true));
$one_txt_source = array('id' => $one_poi['txt_id'], 'poi_name' => $one_poi['title'], 'poi_link' => $one_poi['link'], 'poi_perex' => $one_poi['perex'], 'poi_content_type' => $one_poi['content_type'], 'poi_content' => $one_poi['content'], 'poi_text' => $one_poi['text'], 'IdUser' => $one_poi['txt_user'], 'time_updated' => $one_poi['txt_updated']);
$one_poi_obj->setContent($ps_languageId, new Geo_MapLocationContent(NULL, NULL, $one_txt_source, true));
if (array_key_exists($one_poi['loc_id'], $mm_objs)) {
$poi_mm = $mm_objs[$one_poi['loc_id']];
$one_poi_obj->multimedia = array();
foreach ($poi_mm as $one_mm) {
if ($one_mm) {
$one_poi_obj->multimedia[] = $one_mm;
}
}
}
$objsArray[] = $one_poi_obj;
if (!$p_skipCache || $ps_saveArray) {
$dataArray[] = $one_poi;
}
}
if (!$p_skipCache && CampCache::IsEnabled()) {
$cacheList_arr->storeInCache(array('count' => $p_count, 'data' => $dataArray));
$cacheList_obj->storeInCache(array('count' => $p_count, 'data' => $objsArray));
}
if (empty(self::$s_found_maplocations_list_ext)) {
self::$s_found_maplocations_list_ext = array();
}
self::$s_found_maplocations_list_ext[$list_spec_str] = array('count' => $p_count, 'list_raw' => $dataArray, 'list_obj' => $objsArray);
if ($ps_saveArray) {
$p_rawData = $dataArray;
}
return $objsArray;
}