视频界面卡片
@param null
@return array
179908
function getVideoCard(){
        $listTemplate = new ListTemplate1();
        //设置token
        $tokenArr = array(
                'page' => 'video',
            );
        $listTemplate->setToken($this->genToken($tokenArr));
        //设置模版标题
        $listTemplate->setTitle('视频示例');

        $videoList = $this->getPlayList(self::TYPE_VIDEO);
        if(is_array($videoList) && $videoList){
            foreach($videoList as $video){
                $id = isset($video['id']) && $video['id']?$video['id']:'';
                $title = isset($video['title'])&&$video['title']?$video['title']:'';
                $introduction = isset($video['intro'])&&$video['intro']?$video['intro']:'';
                $picUrl = isset($video['picurl'])&& $video['picurl']?$video['picurl']:'';

                $token = array(
                    'page' => 'video',
                    'item' => strval($id)
                );                            
                //设置模版列表数组listItems其中一项，即列表的一个元素
                $listTemplateItem = new ListTemplateItem();
                $listTemplateItem->setToken($this->genToken($token));
                $listTemplateItem->setImage($picUrl);
                $listTemplateItem->setPlainPrimaryText($title);
                $listTemplateItem->setPlainSecondaryText($introduction);            
                //把listTemplateItem添加到模版listItems
                $listTemplate->addItem($listTemplateItem);
            }
        }  
        //定义RenderTemplate指令
        $template = new RenderTemplate($listTemplate);
        return $template;
    }
1037848
public function getContentAsArray()
    {
        //$nav_item_page = (new \yii\db\Query())->select('*')->from('cms_nav_item_page t1')->leftJoin('cms_layout', 'cms_layout.id=t1.layout_id')->where(['t1.id' => $this->id])->one();
        $nav_item_page = $this;
        
        if (!$nav_item_page->layout) {
            return [];
        }
        
        $return = [
            'nav_item_page' => ['id' => $nav_item_page->id, 'layout_id' => $nav_item_page->layout_id, 'layout_name' => $nav_item_page->layout->name],
            '__placeholders' => [],
        ];
        
        $config = json_decode($nav_item_page->layout->json_config, true);
        
        if (isset($config['placeholders'])) {
            foreach ($config['placeholders'] as $rowKey => $row) {
                foreach ($row as $placeholderKey => $placeholder) {
                    $placeholder['nav_item_page_id'] = $this->id;
                    $placeholder['prev_id'] = 0;
                    $placeholder['__nav_item_page_block_items'] = [];
                    if (!isset($placeholder['cols'])) {
                        $placeholder['cols'] = '12';
                    }
                    
                    $return['__placeholders'][$rowKey][$placeholderKey] = $placeholder;
                    
                    $placeholderVar = $placeholder['var'];
                    
                    $return['__placeholders'][$rowKey][$placeholderKey]['__nav_item_page_block_items'] = self::getPlaceholder($placeholderVar, 0, $this);
                }
            }
        }
        
        return $return;
    }
1157513
public function getArray()
    {
        $address = $two = [];

        $two[] = $this->post_code ?: '';
        $two[] = $this->city      ?: '';
        $two[] = $this->state     ? '('. $this->state .')' : '';

        $address[] = $this->street       ?: '';
        $address[] = $this->street_extra ?: '';
        $address[] = implode(' ', array_filter($two));
        $address[] = $this->country_name ?: '';

        if (count($address = array_filter($address)) > 0)
            return $address;

        return null;
    }
458114
public function getTitle()
    {
        $title = array();
        $row = $this->getPage();
        if (!$row) {
            return null;
        }
        do {
            if ($row->name != '' && $row->name != 'Home') {
                $title[] = $row->name;
            }
        } while ($row = $row->getParentPage());
        return implode(' - ', $title);
    }
704718
private function getFromTo(): array
    {
        if ($this->count < $this->perPage || $this->perPage === null) {
            $start = 1;
            $end = $this->count;
        } else {
            if ($this->hasMorePages()) {
                $end = $this->perPage * $this->currentPage;
                $start = ($end - $this->perPage) + 1;
            } else {
                $endTest = $this->perPage * $this->currentPage;
                $start = ($endTest - $this->perPage) + 1;

                $end = $start + $this->getCountOnLastPage();
            }
        }

        return ['from' => $start, 'to' => $end];
    }
1351841
public function getChildren()
        {
            $hash = key($this->_index);

            if (isset($this->_pages[$hash])) {
                return $this->_pages[$hash];
            }

            return null;
        }
1046441
public function getBreadcrumbs($currentPid = 0, $defaultLabel = '列表', $url = '', $urlParams = [], $appendToTop = [], $append = [])
    {
        /** @var \yii\db\ActiveRecord $model */
        $model = $this->owner;
        // 顶级面包屑
        $breadcrumbs[] = $defaultLabel;
        // 非顶级数据则获取该值的所有父级数据
        if (!empty($currentPid)) {
            if ($model->{$this->pkField} == $currentPid) {
                $self = $model;
            } else {
                /** @var self $self 当前`$currentPid`的模型数据 */
                $self = $model::find()->select([
                    $this->pkField,
                    $this->showTitleField,
                    $this->parentField,
                ])->where([$this->pkField => $currentPid])->one();
            }
            
            // 当前模型数据的所有父级数据
            $parentIds = $self->getParentIds();
            if (!empty($parentIds)) {
                $parents = $model::find()->select([
                    $this->pkField,
                    $this->showTitleField,
                    $this->parentField,
                ])->where([
                    $this->pkField => $parentIds,
                ])->asArray()->all();
                $parents = ArrayHelper::listToTree($parents, $this->pkField, $this->parentField, '_child');
                // 所有的父级面包屑
                $breadcrumbs = ArrayHelper::merge($breadcrumbs, $this->_toFormatBreadcrumbs($parents));
            }
            // 包含自身面包屑
            $breadcrumbs[$self->{$this->pkField}] = $self->{$this->showTitleField};
        }
        
        // 格式化面包屑
        foreach ($breadcrumbs as $id => &$title) {
            $arr = [];
            $arr['label'] = $title;
            if ($currentPid != $id || $append) {
                $arr['url'][] = $url;
                $arr['url'][$this->breadcrumbParentParam] = $id ?: null;
                if ($urlParams) {
                    $arr['url'] = ArrayHelper::merge($urlParams, $arr['url']);
                }
            }
            $title = $arr;
        }
        
        // 添加自定义面包屑在已有面包屑后面
        if ($append) {
            $breadcrumbs = ArrayHelper::merge($breadcrumbs, $append);
        }
        
        // 添加自定义面包屑在所有面包屑前端
        if ($appendToTop) {
            $breadcrumbs = ArrayHelper::merge($appendToTop, $breadcrumbs);
        }
        
        return $breadcrumbs;
    }
153126
public @NotNull List<Page> getPages() {
    return getPages((Predicate<Page>)null, (Page)null);
  }
267112
public static function findAll($page_request = null)
    {
        if($page_request != null){
            return self::listAllReturnOperations(['page' => $page_request->getPageNumber(), 'size' => $page_request->getSize() ]);
        }else {
            return self::listAllReturnOperations();
        }
    }
1366760
public static function findAll($page_request = null)
    {
        if($page_request != null){
            return self::listAllPayments(['page' => $page_request->getPageNumber(), 'size' => $page_request->getSize() ]);
        }else {
            return self::listAllPayments();
        }
    }
1093855
public static function findAll($page_request = null)
    {
        if($page_request != null){
            return self::listAllReturnLineItems(['page' => $page_request->getPageNumber(), 'size' => $page_request->getSize() ]);
        }else {
            return self::listAllReturnLineItems();
        }
    }
372873
public static function findAll($page_request = null)
    {
        if($page_request != null){
            return self::listAllPaymentSources(['page' => $page_request->getPageNumber(), 'size' => $page_request->getSize() ]);
        }else {
            return self::listAllPaymentSources();
        }
    }
372192
public static function getQueryString()
    {
        $querystringsDefault = explode('&', $_SERVER['QUERY_STRING']);
        $querystrings = array();

        foreach ($querystringsDefault as $querystring) {
            $querystring = explode('=', $querystring);
            $querystrings[$querystring[0]] = isset($querystring[1]) ? $querystring[1] : null;
        }

        return $querystrings;
    }
742947
public static function findAll($page_request = null)
    {
        if($page_request != null){
            return self::listAllStoreCreditTransactions(['page' => $page_request->getPageNumber(), 'size' => $page_request->getSize() ]);
        }else {
            return self::listAllStoreCreditTransactions();
        }
    }
1217155
public function getAnchors()
    {
        $list = ArrayList::create();
        
        if ($page = $this->getCurrentPage(Page::class)) {
            
            $html = HTMLValue::create($page->Content);
            
            $anchors = $html->query("//*[@id]");
            
            foreach ($anchors as $anchor) {
                
                $list->push(
                    ArrayData::create([
                        'Link' => $page->Link(sprintf('#%s', $anchor->getAttribute('id'))),
                        'Text' => $anchor->textContent
                    ])
                );
                
            }
            
        }
        
        return $list;
    }
413503
protected function httpReadFirstline()
    {
        if (($l = $this->readline()) === null) {
            return null;
        }
        $e = explode(' ', $l);
        $u = isset($e[1]) ? parse_url($e[1]) : false;
        if ($u === false) {
            $this->badRequest();
            return false;
        }
        if (!isset($u['path'])) {
            $u['path'] = null;
        }
        if (isset($u['host'])) {
            $this->server['HTTP_HOST'] = $u['host'];
        }
        $srv = &$this->server;
        $srv['REQUEST_METHOD'] = $e[0];
        $srv['REQUEST_TIME'] = time();
        $srv['REQUEST_TIME_FLOAT'] = microtime(true);
        $srv['REQUEST_URI'] = $u['path'] . (isset($u['query']) ? '?' . $u['query'] : '');
        $srv['DOCUMENT_URI'] = $u['path'];
        $srv['PHP_SELF'] = $u['path'];
        $srv['QUERY_STRING'] = isset($u['query']) ? $u['query'] : null;
        $srv['SCRIPT_NAME'] = $srv['DOCUMENT_URI'] = isset($u['path']) ? $u['path'] : '/';
        $srv['SERVER_PROTOCOL'] = isset($e[2]) ? $e[2] : 'HTTP/1.1';
        $srv['REMOTE_ADDR'] = $this->addr;
        $srv['REMOTE_PORT'] = $this->port;
        return true;
    }
202136
public function getTextArray(Page $page = null)
	{
		$text                = array();
		$sections            = $this->getSectionsText($this->content);
		$current_font        = new Font($this->document);

		foreach ($sections as $section) {

			$commands = $this->getCommandsText($section);

			foreach ($commands as $command) {

				switch ($command[self::OPERATOR]) {
					// set character spacing
					case 'Tc':
						break;

					// move text current point
					case 'Td':
						break;

					// move text current point and set leading
					case 'TD':
						break;

					case 'Tf':
						list($id,) = preg_split('/\s/s', $command[self::COMMAND]);
						$id           = trim($id, '/');
						$current_font = $page->getFont($id);
						break;

					case "'":
					case 'Tj':
						$command[self::COMMAND] = array($command);
					case 'TJ':
						// Skip if not previously defined, should never happened.
						if (is_null($current_font)) {
							// Fallback
							// TODO : Improve
							$text[] = $command[self::COMMAND][0][self::COMMAND];
							break;
						}

						$sub_text = $current_font->decodeText($command[self::COMMAND]);
						$text[] = $sub_text;
						break;

					// set leading
					case 'TL':
						break;

					case 'Tm':
						break;

					// set super/subscripting text rise
					case 'Ts':
						break;

					// set word spacing
					case 'Tw':
						break;

					// set horizontal scaling
					case 'Tz':
						//$text .= "\n";
						break;

					// move to start of next line
					case 'T*':
						//$text .= "\n";
						break;

					case 'Da':
						break;

					case 'Do':
						if (!is_null($page)) {
							$args = preg_split('/\s/s', $command[self::COMMAND]);
							$id   = trim(array_pop($args), '/ ');
							if ($xobject = $page->getXObject($id)) {
								$text[] = $xobject->getText($page);
							}
						}
						break;

					case 'rg':
					case 'RG':
						break;

					case 're':
						break;

					case 'co':
						break;

					case 'cs':
						break;

					case 'gs':
						break;

					case 'en':
						break;

					case 'sc':
					case 'SC':
						break;

					case 'g':
					case 'G':
						break;

					case 'V':
						break;

					case 'vo':
					case 'Vo':
						break;

					default:
				}
			}
		}

		return $text;
	}