Pocket::load PHP Méthode

load() public méthode

Load the pocket's data from an array.
public load ( array $Data )
$Data array
    public function load($Data)
    {
        $this->Body = $Data['Body'];
        $this->Disabled = $Data['Disabled'];
        $this->Format = $Data['Format'];
        $this->Location = $Data['Location'];
        $this->Name = $Data['Name'];
        $this->Page = $Data['Page'];
        $this->MobileOnly = $Data['MobileOnly'];
        $this->MobileNever = $Data['MobileNever'];
        $this->Type = val('Type', $Data, Pocket::TYPE_DEFAULT);
        $this->EmbeddedNever = val('EmbeddedNever', $Data);
        $this->ShowInDashboard = val('ShowInDashboard', $Data);
        // parse the frequency.
        $Repeat = $Data['Repeat'];
        list($this->RepeatType, $this->RepeatFrequency) = Pocket::parseRepeat($Repeat);
    }

Usage Example

 /**
  *
  *
  * @param bool|false $Force
  */
 protected function _loadState($Force = false)
 {
     if (!$Force && $this->StateLoaded) {
         return;
     }
     $Pockets = Gdn::sql()->get('Pocket', 'Location, Sort, Name')->resultArray();
     foreach ($Pockets as $Row) {
         $Pocket = new Pocket();
         $Pocket->load($Row);
         $this->addPocket($Pocket);
     }
     $this->StateLoaded = true;
 }