1<?php 2/** 3 * Copyright 2017 Facebook, Inc. 4 * 5 * You are hereby granted a non-exclusive, worldwide, royalty-free license to 6 * use, copy, modify, and distribute this software in source code or binary 7 * form for use in connection with the web services and APIs provided by 8 * Facebook. 9 * 10 * As with any software that integrates with the Facebook platform, your use 11 * of this software is subject to the Facebook Developer Principles and 12 * Policies [http://developers.facebook.com/policy/]. This copyright notice 13 * shall be included in all copies or substantial portions of the software. 14 * 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 * DEALINGS IN THE SOFTWARE. 22 * 23 */ 24namespace Facebook\GraphNodes; 25 26/** 27 * Class GraphAlbum 28 * 29 * @package Facebook 30 */ 31 32class GraphAlbum extends GraphNode 33{ 34 /** 35 * @var array Maps object key names to Graph object types. 36 */ 37 protected static $graphObjectMap = [ 38 'from' => '\Facebook\GraphNodes\GraphUser', 39 'place' => '\Facebook\GraphNodes\GraphPage', 40 ]; 41 42 /** 43 * Returns the ID for the album. 44 * 45 * @return string|null 46 */ 47 public function getId() 48 { 49 return $this->getField('id'); 50 } 51 52 /** 53 * Returns whether the viewer can upload photos to this album. 54 * 55 * @return boolean|null 56 */ 57 public function getCanUpload() 58 { 59 return $this->getField('can_upload'); 60 } 61 62 /** 63 * Returns the number of photos in this album. 64 * 65 * @return int|null 66 */ 67 public function getCount() 68 { 69 return $this->getField('count'); 70 } 71 72 /** 73 * Returns the ID of the album's cover photo. 74 * 75 * @return string|null 76 */ 77 public function getCoverPhoto() 78 { 79 return $this->getField('cover_photo'); 80 } 81 82 /** 83 * Returns the time the album was initially created. 84 * 85 * @return \DateTime|null 86 */ 87 public function getCreatedTime() 88 { 89 return $this->getField('created_time'); 90 } 91 92 /** 93 * Returns the time the album was updated. 94 * 95 * @return \DateTime|null 96 */ 97 public function getUpdatedTime() 98 { 99 return $this->getField('updated_time'); 100 } 101 102 /** 103 * Returns the description of the album. 104 * 105 * @return string|null 106 */ 107 public function getDescription() 108 { 109 return $this->getField('description'); 110 } 111 112 /** 113 * Returns profile that created the album. 114 * 115 * @return GraphUser|null 116 */ 117 public function getFrom() 118 { 119 return $this->getField('from'); 120 } 121 122 /** 123 * Returns profile that created the album. 124 * 125 * @return GraphPage|null 126 */ 127 public function getPlace() 128 { 129 return $this->getField('place'); 130 } 131 132 /** 133 * Returns a link to this album on Facebook. 134 * 135 * @return string|null 136 */ 137 public function getLink() 138 { 139 return $this->getField('link'); 140 } 141 142 /** 143 * Returns the textual location of the album. 144 * 145 * @return string|null 146 */ 147 public function getLocation() 148 { 149 return $this->getField('location'); 150 } 151 152 /** 153 * Returns the title of the album. 154 * 155 * @return string|null 156 */ 157 public function getName() 158 { 159 return $this->getField('name'); 160 } 161 162 /** 163 * Returns the privacy settings for the album. 164 * 165 * @return string|null 166 */ 167 public function getPrivacy() 168 { 169 return $this->getField('privacy'); 170 } 171 172 /** 173 * Returns the type of the album. 174 * 175 * enum{ profile, mobile, wall, normal, album } 176 * 177 * @return string|null 178 */ 179 public function getType() 180 { 181 return $this->getField('type'); 182 } 183} 184