/** * Handle new-ing a pmp doc (without saving it) * * @return boolean success */ protected function new_doc() { $sdk = new SDKWrapper(); $this->doc = $sdk->newDoc('base', array('attributes' => array('title' => $this->post->post_title, 'published' => date('c', strtotime($this->post->post_date)), 'itags' => array_merge(self::$ITAGS, array("post-id-{$this->post->ID}"))))); return true; }
function _pmp_create_doc($type, $data) { $sdk = new SDKWrapper(); if (!empty($data->attributes->tags)) { $data->attributes->tags = SDKWrapper::commas2array($data->attributes->tags); } $doc = $sdk->newDoc($type, $data); $doc->save(); return $doc; }