| | |
| | | namespace JVBase\managers\queue\executors; |
| | | |
| | | use JVBase\managers\queue\{Executor, Operation, Progress, Result, Storage}; |
| | | use JVBase\meta\MetaManager; |
| | | use JVBase\meta\Meta; |
| | | use JVBase\utility\Features; |
| | | use Exception; |
| | | |
| | |
| | | return true; |
| | | } |
| | | |
| | | $meta = new MetaManager($postId, 'post'); |
| | | return $meta->setAll($allowedFields); |
| | | $meta = Meta::forPost($postId); |
| | | $meta->setAll($allowedFields); |
| | | return true; |
| | | } |
| | | |
| | | // ───────────────────────────────────────────────────────────── |
| | |
| | | |
| | | $lastKey = array_key_last($posts); |
| | | foreach ($posts as $index => $post) { |
| | | $meta = new MetaManager($post->ID, 'post'); |
| | | $meta = Meta::forPost($post->ID); |
| | | if ($index === 0) { |
| | | $meta->updateValue('timeline', '', false); |
| | | $meta->set('timeline', '', false); |
| | | $previousPost = $post; |
| | | continue; // Parent has no timeline |
| | | } |
| | |
| | | if ($timeline) { |
| | | $termId = $this->getOrCreateTerm($timeline, 'timeline'); |
| | | if ($termId) { |
| | | $success = $meta->updateValue('timeline', $termId, false); |
| | | $success = $meta->set('timeline', $termId, false); |
| | | } |
| | | } |
| | | } |
| | |
| | | protected function checkSharedFields(array $fields): void |
| | | { |
| | | foreach ($fields as $parentID => $shared) { |
| | | $meta = new MetaManager($parentID, 'post'); |
| | | $meta = Meta::forPost($parentID); |
| | | $values = $meta->getAll($shared); |
| | | |
| | | $children = get_children([ |
| | |
| | | } |
| | | |
| | | foreach ($children as $child) { |
| | | $childMeta = new MetaManager($child, 'post'); |
| | | $childMeta = Meta::forPost($child); |
| | | $result = $childMeta->setAll($values, false); |
| | | } |
| | | } |