Model/Tag.php
changeset 42 0e57c730bb18
parent 14 673b2766024e
child 43 54f204bceb28
equal deleted inserted replaced
39:b403086580f7 42:0e57c730bb18
    34 
    34 
    35     /**
    35     /**
    36      * @var string $originalLabel
    36      * @var string $originalLabel
    37      */
    37      */
    38     protected $originalLabel;
    38     protected $originalLabel;
       
    39     
       
    40     /**
       
    41      * @var $alternativeLabel
       
    42      */
       
    43     protected $alternativeLabel;
    39 
    44 
    40     /**
    45     /**
    41      * @var string $alias
    46      * @var string $alias
    42      */
    47      */
    43     protected $alias;
    48     protected $alias;
    46      * @var string $wikipediaUrl
    51      * @var string $wikipediaUrl
    47      */
    52      */
    48     protected $wikipediaUrl;
    53     protected $wikipediaUrl;
    49 
    54 
    50     /**
    55     /**
       
    56     * @var string $alternativeWikipediaUrl
       
    57     */
       
    58     protected $alternativeWikipediaUrl;
       
    59         
       
    60     
       
    61     /**
    51      * @var bigint $wikipediaPageId
    62      * @var bigint $wikipediaPageId
    52      */
    63      */
    53     protected $wikipediaPageId;
    64     protected $wikipediaPageId;
    54 
    65 
       
    66    /**
       
    67     * @var bigint $alternativeWikipediaPageId
       
    68     */
       
    69     protected $alternativeWikipediaPageId;
       
    70     
    55     /**
    71     /**
    56      * @var smallint $urlStatus
    72      * @var smallint $urlStatus
    57      */
    73      */
    58     protected $urlStatus;
    74     protected $urlStatus;
    59 
    75 
   148     {
   164     {
   149         return $this->originalLabel;
   165         return $this->originalLabel;
   150     }
   166     }
   151 
   167 
   152     /**
   168     /**
       
   169     * Set alternativeLabel
       
   170     *
       
   171     * @param string $alternativeLabel
       
   172     */
       
   173     public function setAlternativeLabel($alternativeLabel)
       
   174     {
       
   175         $this->alternativeLabel = $alternativeLabel;
       
   176     }
       
   177     
       
   178     /**
       
   179      * Get alternativeLabel
       
   180      *
       
   181      * @return string
       
   182      */
       
   183     public function getAlternativeLabel()
       
   184     {
       
   185         return $this->alternativeLabel;
       
   186     }
       
   187     
       
   188     
       
   189     
       
   190     /**
   153      * Set alias
   191      * Set alias
   154      *
   192      *
   155      * @param string $alias
   193      * @param string $alias
   156      */
   194      */
   157     public function setAlias($alias)
   195     public function setAlias($alias)
   187     public function getWikipediaUrl()
   225     public function getWikipediaUrl()
   188     {
   226     {
   189         return $this->wikipediaUrl;
   227         return $this->wikipediaUrl;
   190     }
   228     }
   191 
   229 
       
   230     
       
   231     /**
       
   232     * Set alternativeWikipediaUrl
       
   233     *
       
   234     * @param string $alternativeWikipediaUrl
       
   235     */
       
   236     public function setAlternativeWikipediaUrl($alternativeWikipediaUrl)
       
   237     {
       
   238         $this->alternativeWikipediaUrl = $alternativeWikipediaUrl;
       
   239     }
       
   240     
       
   241     /**
       
   242      * Get alternativeWikipediaUrl
       
   243      *
       
   244      * @return string
       
   245      */
       
   246     public function getAlternativeWikipediaUrl()
       
   247     {
       
   248         return $this->alternativeWikipediaUrl;
       
   249     }
       
   250     
       
   251     
   192     /**
   252     /**
   193      * Set wikipediaPageId
   253      * Set wikipediaPageId
   194      *
   254      *
   195      * @param bigint $wikipediaPageId
   255      * @param bigint $wikipediaPageId
   196      */
   256      */
   207     public function getWikipediaPageId()
   267     public function getWikipediaPageId()
   208     {
   268     {
   209         return $this->wikipediaPageId;
   269         return $this->wikipediaPageId;
   210     }
   270     }
   211 
   271 
       
   272     /**
       
   273     * Set alternativeWikipediaPageId
       
   274     *
       
   275     * @param bigint $alternativeWikipediaPageId
       
   276     */
       
   277     function setAlternativeWikipediaPageId($alternativeWikipediaPageId)
       
   278     {
       
   279         $this->alternativeWikipediaPageId = $alternativeWikipediaPageId;
       
   280     }
       
   281     
       
   282     /**
       
   283      * Get alternativeWikipediaPageId
       
   284      *
       
   285      * @return bigint
       
   286      */
       
   287     function getAlternativeWikipediaPageId()
       
   288     {
       
   289         return $this->alternativeWikipediaPageId;
       
   290     }
       
   291     
       
   292     
   212     /**
   293     /**
   213      * Set urlStatus
   294      * Set urlStatus
   214      *
   295      *
   215      * @param smallint $urlStatus
   296      * @param smallint $urlStatus
   216      */
   297      */
   326     function nullCategory()
   407     function nullCategory()
   327     {
   408     {
   328         return $this->setCategory(NULL);
   409         return $this->setCategory(NULL);
   329     }
   410     }
   330     
   411     
       
   412     
       
   413     /**
       
   414      * (non-PHPdoc)
       
   415      * @see IRI\Bundle\WikiTagBundle\Model.TagInterface::setWikipediaInfo()
       
   416      */
       
   417     function setWikipediaInfo($wikipedia_info)
       
   418     {
       
   419         $new_label = $wikipedia_info['new_label'];
       
   420         $status = $wikipedia_info['status'];
       
   421         $url = $wikipedia_info['wikipedia_url'];
       
   422         $pageid = $wikipedia_info['pageid'];
       
   423         $dbpedia_uri = $wikipedia_info["dbpedia_uri"];
       
   424         $wikipedia_revision_id = $wikipedia_info['revision_id'];
       
   425         $alternative_label = array_key_exists('alternative_label', $wikipedia_info) ? $wikipedia_info['alternative_label'] : null;
       
   426         $alternative_url = array_key_exists('wikipedia_alternative_url', $wikipedia_info) ? $wikipedia_info['wikipedia_alternative_url'] : null;
       
   427         $alternative_pageid = array_key_exists('alternative_pageid', $wikipedia_info) ? $wikipedia_info['alternative_pageid'] : null;
       
   428         
       
   429         # We save the datas
       
   430         if($new_label!=null)
       
   431         {
       
   432             $this->setLabel($new_label);
       
   433         }
       
   434         
       
   435         if($status!=null)
       
   436         {
       
   437             $this->setUrlStatus($status);
       
   438         }
       
   439 
       
   440         $this->setWikipediaUrl($url);
       
   441         $this->setWikipediaPageId($pageid);
       
   442         $this->setDbpediaUri($dbpedia_uri);
       
   443         $this->setAlternativeLabel($alternative_label);
       
   444         $this->setAlternativeWikipediaUrl($alternative_url);
       
   445         $this->setAlternativeWikipediaPageId($alternative_pageid);
       
   446         
       
   447     }
       
   448     
   331      
   449      
   332  }
   450  }