本文整理汇总了PHP中kArray::append方法的典型用法代码示例。如果您正苦于以下问题:PHP kArray::append方法的具体用法?PHP kArray::append怎么用?PHP kArray::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kArray
的用法示例。
在下文中一共展示了kArray::append方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getUpdateableFields
public function getUpdateableFields()
{
return kArray::append($this->basic_fields, $this->regular_fields_ext, $this->detailed_fields_ext);
// leave out the objects !
/* if ( self::$accumulated_updateable_fields == null )
{
self::$accumulated_updateable_fields = kArray::append ( $this->basic_fields , $this->regular_fields_ext , $this->detailed_fields_ext ); // leave out the objects !
// TODO - remove all the read only fields
}
return self::$accumulated_updateable_fields;
*/
}
示例2: executeImpl
protected function executeImpl(kshow $kshow, entry &$entry)
{
$list_type = $this->getP("list_type", self::LIST_TYPE_ALL);
$kshow_entry_list = array();
$kuser_entry_list = array();
if ($list_type & self::LIST_TYPE_KSHOW) {
$c = new Criteria();
$c->add(entryPeer::TYPE, entryType::MEDIA_CLIP);
$c->add(entryPeer::MEDIA_TYPE, entry::ENTRY_MEDIA_TYPE_SHOW, Criteria::NOT_EQUAL);
$c->add(entryPeer::KSHOW_ID, $this->kshow_id);
$kshow_entry_list = entryPeer::doSelectJoinkuser($c);
}
if ($list_type & self::LIST_TYPE_KUSER) {
$c = new Criteria();
$c->add(entryPeer::TYPE, entryType::MEDIA_CLIP);
$c->add(entryPeer::MEDIA_TYPE, entry::ENTRY_MEDIA_TYPE_SHOW, Criteria::NOT_EQUAL);
$c->add(entryPeer::KUSER_ID, $this->getLoggedInUserIds(), Criteria::IN);
$kuser_entry_list = entryPeer::doSelectJoinkuser($c);
}
if ($list_type & self::LIST_TYPE_EPISODE) {
if ($kshow->getEpisodeId()) {
// episode_id will point to the "parent" kshow
// fetch the entries of the parent kshow
$c = new Criteria();
$c->add(entryPeer::TYPE, entryType::MEDIA_CLIP);
$c->add(entryPeer::MEDIA_TYPE, entry::ENTRY_MEDIA_TYPE_SHOW, Criteria::NOT_EQUAL);
$c->add(entryPeer::KSHOW_ID, $kshow->getEpisodeId());
$parent_kshow_entries = entryPeer::doSelectJoinkuser($c);
if (count($parent_kshow_entries)) {
$kshow_entry_list = kArray::append($kshow_entry_list, $parent_kshow_entries);
}
}
}
// fetch all entries that were used in the roughcut - those of other kusers
// - appeared under kuser_entry_list when someone else logged in
if ($list_type & self::LIST_TYPE_ROUGHCUT) {
if ($kshow->getHasRoughcut()) {
$roughcut_file_name = $entry->getDataPath();
$entry_ids_from_roughcut = myFlvStreamer::getAllAssetsIds($roughcut_file_name);
$final_id_list = array();
foreach ($entry_ids_from_roughcut as $id) {
$found = false;
foreach ($kshow_entry_list as $entry) {
if ($entry->getId() == $id) {
$found = true;
break;
}
}
if (!$found) {
$final_id_list[] = $id;
}
}
$c = new Criteria();
$c->add(entryPeer::ID, $final_id_list, Criteria::IN);
$extra_entries = entryPeer::doSelectJoinkuser($c);
// merge the 2 lists into 1:
$kshow_entry_list = kArray::append($kshow_entry_list, $extra_entries);
}
}
$this->kshow_entry_list = $kshow_entry_list;
$this->kuser_entry_list = $kuser_entry_list;
}
示例3: dirListExtended
public static function dirListExtended($directory, $return_directory_as_prefix = true, $should_recurse = false, $file_pattern = NULL, $depth = 0, $fetch_content = false)
{
if ($depth > 10) {
// exceeded the recursion depth
return NULL;
}
// create an array to hold directory list
$results = array();
// create a handler for the directory
$handler = @opendir($directory);
if (!$handler) {
return NULL;
}
// echo ( "directory: " .$directory . "<br>" );
$current_path = pathinfo($directory, PATHINFO_DIRNAME) . "/" . pathinfo($directory, PATHINFO_BASENAME) . "/";
// keep going until all files in directory have been read
while (($file = readdir($handler)) != NULL) {
// if $file isn't this directory or its parent,
// add it to the results array
if ($file != '.' && $file != '..') {
if (!$file_pattern) {
$match = 1;
} else {
$match = preg_match($file_pattern, $file);
}
if ($match > 0) {
$file_full_path = $directory . "/" . $file;
$result = array();
// first - name (with or without the full path)
$result[] = ($return_directory_as_prefix ? $directory . "/" : "") . $file;
// second - size
$result[] = self::fileSize($file_full_path);
// third - time
$result[] = filemtime($file_full_path);
// forth - content (only if requested
if ($fetch_content) {
$result[] = file_get_contents($file_full_path);
}
$results[] = $result;
}
if ($should_recurse && is_dir($current_path . $file)) {
// echo "Recursing... [$should_recurse] [$current_path $file]<br>";
$child_dir_results = self::dirListExtended($current_path . $file, $return_directory_as_prefix, $should_recurse, $file_pattern, ++$depth);
if ($child_dir_results) {
$results = kArray::append($results, $child_dir_results);
}
}
}
}
// tidy up: close the handler
closedir($handler);
// done!
return $results;
}
示例4: executeImpl
//.........这里部分代码省略.........
}
if ($apiv3Kuser) {
$strEntriesTemp = @unserialize($apiv3Kuser->getPartnerData());
if ($strEntriesTemp) {
$strEntries .= $strEntriesTemp;
}
}
if ($strEntries) {
$entries = explode(',', $strEntries);
$fixed_entry_list = array();
foreach ($entries as $entryId) {
$fixed_entry_list[] = trim($entryId);
}
$c = new Criteria();
$c->addAnd(entryPeer::TYPE, entryType::MEDIA_CLIP);
$c->addAnd(entryPeer::ID, $fixed_entry_list, Criteria::IN);
if ($merge_entry_lists) {
// if will join lists - no need to fetch entries twice
$this->addIgnoreIdList($c, $aggrigate_id_list);
}
if ($disable_user_data) {
$extra_user_entries = entryPeer::doSelect($c);
} else {
$extra_user_entries = entryPeer::doSelectJoinkuser($c);
}
if (count($extra_user_entries)) {
$kuser_entry_list = array_merge($extra_user_entries, $kuser_entry_list);
}
}
} else {
$kuser_entry_list = array();
}
if ($merge_entry_lists) {
$kshow_entry_list = kArray::append($kshow_entry_list, $kuser_entry_list);
$kuser_entry_list = null;
}
}
$this->benchmarkEnd("list_type_kuser");
$this->benchmarkStart("list_type_episode");
if ($list_type & self::LIST_TYPE_EPISODE) {
if ($kshow && $kshow->getEpisodeId()) {
// episode_id will point to the "parent" kshow
// fetch the entries of the parent kshow
$c = new Criteria();
$c->addAnd(entryPeer::TYPE, entryType::MEDIA_CLIP);
// $c->addAnd ( entryPeer::MEDIA_TYPE , entry::ENTRY_MEDIA_TYPE_SHOW , Criteria::NOT_EQUAL );
$c->addAnd(entryPeer::KSHOW_ID, $kshow->getEpisodeId());
$this->addIgnoreIdList($c, $aggrigate_id_list);
// $this->addOffsetAndLimit ( $c ); // limit the number of the inherited entries from the episode
if ($disable_user_data) {
$parent_kshow_entries = entryPeer::doSelect($c);
} else {
$parent_kshow_entries = entryPeer::doSelectJoinkuser($c);
}
if (count($parent_kshow_entries)) {
$kshow_entry_list = kArray::append($kshow_entry_list, $parent_kshow_entries);
}
}
}
$this->benchmarkEnd("list_type_episode");
// fetch all entries that were used in the roughcut - those of other kusers
// - appeared under kuser_entry_list when someone else logged in
$this->benchmarkStart("list_type_roughcut");
$entry_data_from_roughcut_map = array();
// will hold an associative array where the id is the key
if ($list_type & self::LIST_TYPE_ROUGHCUT) {