else { echo "failed change content and get content<br />"; } $data = DBDataType::GetPrimaryData("test", 125); if ($data[DBDataType::METADATA] == "test:test3") { echo "passed insert and get test with meta<br />"; } else { echo "failed insert and get test with meta<br />"; } DBDataType::UpdateContentFromOrigin("content 3 extended", $data[DBDataType::ORIGIN_TYPE], $data[DBDataType::ORIGIN_ID]); $data = DBDataType::GetDataContentFromOrigin("test", 125); if ($data == "content 3 extended") { echo "passed change content and get content<br />"; } else { echo "failed change content and get content<br />"; } DBDataType::DeleteAllFromOriginType("test"); ?>
/** * * @param int $post_id * @return array */ public function post_get($post_id, $content = true) { if (!is_numeric($post_id)) { throw new DBForumException( '$post_id must be numeric'); } if (!is_bool($content)) { throw new DBForumException( '$content must be boolean'); } try { $result = $this->db->quick_query( "SELECT * FROM ".self::FCORE_FORUM_POST." WHERE ".self::FORUM_ID."=$this->forum_id && ".self::POST_ID."=$post_id", true); if ($result == null) { return null; } $result = $result[0]; if ($content) { $result[DBDataType::CONTENT] = DBDataType::GetDataContentFromOrigin( self::build_datatype_origin($this->origin_type), $post_id); } return $result; } catch(Exception $e) { throw new DBForumException($e->getMessage()); } }