WikidotMeta Class


This class extends the WikidotSite Class. This class also adds properties for file meta data. There are get/set methods for each property. This class can perform the following API call:

  • pages.get_meta

The API method has an example under the API Methods drop down menu. The below steps are common to the use of this class.

Syntax Examples

Create the start of the PHP page just like the WikidotSite parent class.
Create the object by making a call to the constructor and setup the return variable:

$metaobj = new WikidotMeta($SiteName, $Client);
$returnarray = array();

The Code

//////////////////pages classes
//////////////////parent WikidotMeta Class
class WikidotMeta extends WikidotSite
{//////////////////constructor destructor
function __construct($spSite, $spClient)
{    echo "Subclass Constructor called....</br>";
    WikidotSite::__construct($spSite, $spClient);
    $this->site = WikidotSite::getSite();
    $this->client = WikidotSite::getClient();
    $this->timeout = WikidotSite::getTimeout();
    $this->debug = WikidotSite::getDebug();
function __destruct()
{    echo "Subclass Destructor called....</br>";
    foreach ($this as $key => $value) {
//////////////////set functions
//////////////////meta properties
private $metapages;
private $fullname;
private $created_at;
private $created_by;
private $updated_at;
private $updated_by;
private $title;
private $parent_fullname; //was  = "-";
private $tags; //xmlrpcval array of tags
private $rating;
private $revisions;
private $metacomments;    //planned
private $files;        //planned
private $metachildren;    //planned
//////////////////set functions
function setFullname($pFName){$this->fullname = $pFName;}
function setCreatedAt($pCAt){$this->created_at = $pCAt;}
function setCreatedBy($pCBy){$this->created_by = $pCBy;}
function setUpdatedAt($pUAt){$this->updated_at = $pUAt;}
function setUpdatedBy($pUBy){$this->updated_by = $pUBy;}
function setTitle($pTitle){$this->title = $pTitle;}
function setParentFullname($pParent){$this->parent_fullname = $pParent;}
function setTags($tarray)
{    $temparray = array();
    foreach($tarray as $key=>$tval){
        $temparray[$key] = new xmlrpcval($tval);}
    $this->tags = new xmlrpcval($temparray, "array");
function setRating($pRate){$this->rating = $pRate;}
function setRevisions($pRev){$this->revision = $pRev;}
//////////////////get functions
function getMetapages(){return $this->metapages;}
function getFullname(){return $this->fullname;}
function getCreatedAt(){return $this->create_at;}
function getCreatedBy(){return $this->created_by;}
function getUpdatedAt(){return $this->updated_at;}
function getUpdatedBy(){return $this->updated_by;}
function getTitle(){return $this->title;}
function getParentFullname(){return $this->parent_fullname;}
function getTags(){return $this->tags;}
function getRating(){return $this->rating;}
function getRevisions(){return $this->revisions;}
function getMetacomments(){return $this->metacomments;}
function getFiles(){return $this->files;}
function getMetachildren(){return $this->metachildren;}
//////////////////api wrapper functions
function php_pages_get_meta($pArray, &$returnar)
{    echo "</br>Start New Pages Get Meta</br>\n";
    $request = new xmlrpcmsg("pages.get_meta");
    $temparray = array();
//    $pArray['a'] = ""; //forces $pArray to be an array
    foreach($pArray as $key=>$tval){
        $temparray[$key] = new xmlrpcval($tval);}
    $pagearray = new xmlrpcval($temparray, "array");
    $request->addParam(new xmlrpcval(
            array("site" => new xmlrpcval($this->site, "string"),
                "pages" => $pagearray),"struct"));
    $result = $this->client->send($request, $this->timeout, "https");
    $resultvalue = $result->value();
    if(!$result->faultCode()) { // SUCCESS!
        $returnar = $resultvalue;
        return true; }
    else {echo "<font color=\"red\"> <H1>Fault</H1><BR>\n"." Code: ".$result->faultCode()."\n<BR>".
        " Reason: ".$result->faultString()."'\n<BR></font>";
        return false;}
}//end class WikidotMeta
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License