Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame^] | 1 | <?php |
| 2 | |
| 3 | namespace Adldap\Models; |
| 4 | |
| 5 | /** |
| 6 | * Class Printer. |
| 7 | * |
| 8 | * Represents an LDAP printer. |
| 9 | */ |
| 10 | class Printer extends Entry |
| 11 | { |
| 12 | /** |
| 13 | * Returns the printers name. |
| 14 | * |
| 15 | * @link https://msdn.microsoft.com/en-us/library/ms679385(v=vs.85).aspx |
| 16 | * |
| 17 | * @return string |
| 18 | */ |
| 19 | public function getPrinterName() |
| 20 | { |
| 21 | return $this->getFirstAttribute($this->schema->printerName()); |
| 22 | } |
| 23 | |
| 24 | /** |
| 25 | * Returns the printers share name. |
| 26 | * |
| 27 | * @link https://msdn.microsoft.com/en-us/library/ms679408(v=vs.85).aspx |
| 28 | * |
| 29 | * @return string |
| 30 | */ |
| 31 | public function getPrinterShareName() |
| 32 | { |
| 33 | return $this->getFirstAttribute($this->schema->printerShareName()); |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * Returns the printers memory. |
| 38 | * |
| 39 | * @link https://msdn.microsoft.com/en-us/library/ms679396(v=vs.85).aspx |
| 40 | * |
| 41 | * @return string |
| 42 | */ |
| 43 | public function getMemory() |
| 44 | { |
| 45 | return $this->getFirstAttribute($this->schema->printerMemory()); |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * Returns the printers URL. |
| 50 | * |
| 51 | * @return string |
| 52 | */ |
| 53 | public function getUrl() |
| 54 | { |
| 55 | return $this->getFirstAttribute($this->schema->url()); |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * Returns the printers location. |
| 60 | * |
| 61 | * @link https://msdn.microsoft.com/en-us/library/ms676839(v=vs.85).aspx |
| 62 | * |
| 63 | * @return string |
| 64 | */ |
| 65 | public function getLocation() |
| 66 | { |
| 67 | return $this->getFirstAttribute($this->schema->location()); |
| 68 | } |
| 69 | |
| 70 | /** |
| 71 | * Returns the server name that the |
| 72 | * current printer is connected to. |
| 73 | * |
| 74 | * @link https://msdn.microsoft.com/en-us/library/ms679772(v=vs.85).aspx |
| 75 | * |
| 76 | * @return string |
| 77 | */ |
| 78 | public function getServerName() |
| 79 | { |
| 80 | return $this->getFirstAttribute($this->schema->serverName()); |
| 81 | } |
| 82 | |
| 83 | /** |
| 84 | * Returns true / false if the printer can print in color. |
| 85 | * |
| 86 | * @link https://msdn.microsoft.com/en-us/library/ms679382(v=vs.85).aspx |
| 87 | * |
| 88 | * @return null|bool |
| 89 | */ |
| 90 | public function getColorSupported() |
| 91 | { |
| 92 | return $this->convertStringToBool( |
| 93 | $this->getFirstAttribute( |
| 94 | $this->schema->printerColorSupported() |
| 95 | ) |
| 96 | ); |
| 97 | } |
| 98 | |
| 99 | /** |
| 100 | * Returns true / false if the printer supports duplex printing. |
| 101 | * |
| 102 | * @link https://msdn.microsoft.com/en-us/library/ms679383(v=vs.85).aspx |
| 103 | * |
| 104 | * @return null|bool |
| 105 | */ |
| 106 | public function getDuplexSupported() |
| 107 | { |
| 108 | return $this->convertStringToBool( |
| 109 | $this->getFirstAttribute( |
| 110 | $this->schema->printerDuplexSupported() |
| 111 | ) |
| 112 | ); |
| 113 | } |
| 114 | |
| 115 | /** |
| 116 | * Returns an array of printer paper types that the printer supports. |
| 117 | * |
| 118 | * @link https://msdn.microsoft.com/en-us/library/ms679395(v=vs.85).aspx |
| 119 | * |
| 120 | * @return array |
| 121 | */ |
| 122 | public function getMediaSupported() |
| 123 | { |
| 124 | return $this->getAttribute($this->schema->printerMediaSupported()); |
| 125 | } |
| 126 | |
| 127 | /** |
| 128 | * Returns true / false if the printer supports stapling. |
| 129 | * |
| 130 | * @link https://msdn.microsoft.com/en-us/library/ms679410(v=vs.85).aspx |
| 131 | * |
| 132 | * @return null|bool |
| 133 | */ |
| 134 | public function getStaplingSupported() |
| 135 | { |
| 136 | return $this->convertStringToBool( |
| 137 | $this->getFirstAttribute( |
| 138 | $this->schema->printerStaplingSupported() |
| 139 | ) |
| 140 | ); |
| 141 | } |
| 142 | |
| 143 | /** |
| 144 | * Returns an array of the printers bin names. |
| 145 | * |
| 146 | * @link https://msdn.microsoft.com/en-us/library/ms679380(v=vs.85).aspx |
| 147 | * |
| 148 | * @return array |
| 149 | */ |
| 150 | public function getPrintBinNames() |
| 151 | { |
| 152 | return $this->getAttribute($this->schema->printerBinNames()); |
| 153 | } |
| 154 | |
| 155 | /** |
| 156 | * Returns the printers maximum resolution. |
| 157 | * |
| 158 | * @link https://msdn.microsoft.com/en-us/library/ms679391(v=vs.85).aspx |
| 159 | * |
| 160 | * @return string |
| 161 | */ |
| 162 | public function getPrintMaxResolution() |
| 163 | { |
| 164 | return $this->getFirstAttribute($this->schema->printerMaxResolutionSupported()); |
| 165 | } |
| 166 | |
| 167 | /** |
| 168 | * Returns the printers orientations supported. |
| 169 | * |
| 170 | * @link https://msdn.microsoft.com/en-us/library/ms679402(v=vs.85).aspx |
| 171 | * |
| 172 | * @return string |
| 173 | */ |
| 174 | public function getPrintOrientations() |
| 175 | { |
| 176 | return $this->getFirstAttribute($this->schema->printerOrientationSupported()); |
| 177 | } |
| 178 | |
| 179 | /** |
| 180 | * Returns the driver name of the printer. |
| 181 | * |
| 182 | * @link https://msdn.microsoft.com/en-us/library/ms675652(v=vs.85).aspx |
| 183 | * |
| 184 | * @return string |
| 185 | */ |
| 186 | public function getDriverName() |
| 187 | { |
| 188 | return $this->getFirstAttribute($this->schema->driverName()); |
| 189 | } |
| 190 | |
| 191 | /** |
| 192 | * Returns the printer drivers version number. |
| 193 | * |
| 194 | * @link https://msdn.microsoft.com/en-us/library/ms675653(v=vs.85).aspx |
| 195 | * |
| 196 | * @return string |
| 197 | */ |
| 198 | public function getDriverVersion() |
| 199 | { |
| 200 | return $this->getFirstAttribute($this->schema->driverVersion()); |
| 201 | } |
| 202 | |
| 203 | /** |
| 204 | * Returns the priority number of the printer. |
| 205 | * |
| 206 | * @link https://msdn.microsoft.com/en-us/library/ms679413(v=vs.85).aspx |
| 207 | * |
| 208 | * @return string |
| 209 | */ |
| 210 | public function getPriority() |
| 211 | { |
| 212 | return $this->getFirstAttribute($this->schema->priority()); |
| 213 | } |
| 214 | |
| 215 | /** |
| 216 | * Returns the printers start time. |
| 217 | * |
| 218 | * @link https://msdn.microsoft.com/en-us/library/ms679411(v=vs.85).aspx |
| 219 | * |
| 220 | * @return string |
| 221 | */ |
| 222 | public function getPrintStartTime() |
| 223 | { |
| 224 | return $this->getFirstAttribute($this->schema->printerStartTime()); |
| 225 | } |
| 226 | |
| 227 | /** |
| 228 | * Returns the printers end time. |
| 229 | * |
| 230 | * @link https://msdn.microsoft.com/en-us/library/ms679384(v=vs.85).aspx |
| 231 | * |
| 232 | * @return string |
| 233 | */ |
| 234 | public function getPrintEndTime() |
| 235 | { |
| 236 | return $this->getFirstAttribute($this->schema->printerEndTime()); |
| 237 | } |
| 238 | |
| 239 | /** |
| 240 | * Returns the port name of printer. |
| 241 | * |
| 242 | * @link https://msdn.microsoft.com/en-us/library/ms679131(v=vs.85).aspx |
| 243 | * |
| 244 | * @return string |
| 245 | */ |
| 246 | public function getPortName() |
| 247 | { |
| 248 | return $this->getFirstAttribute($this->schema->portName()); |
| 249 | } |
| 250 | |
| 251 | /** |
| 252 | * Returns the printers version number. |
| 253 | * |
| 254 | * @link https://msdn.microsoft.com/en-us/library/ms680897(v=vs.85).aspx |
| 255 | * |
| 256 | * @return string |
| 257 | */ |
| 258 | public function getVersionNumber() |
| 259 | { |
| 260 | return $this->getFirstAttribute($this->schema->versionNumber()); |
| 261 | } |
| 262 | |
| 263 | /** |
| 264 | * Returns the print rate. |
| 265 | * |
| 266 | * @link https://msdn.microsoft.com/en-us/library/ms679405(v=vs.85).aspx |
| 267 | * |
| 268 | * @return string |
| 269 | */ |
| 270 | public function getPrintRate() |
| 271 | { |
| 272 | return $this->getFirstAttribute($this->schema->printerPrintRate()); |
| 273 | } |
| 274 | |
| 275 | /** |
| 276 | * Returns the print rate unit. |
| 277 | * |
| 278 | * @link https://msdn.microsoft.com/en-us/library/ms679406(v=vs.85).aspx |
| 279 | * |
| 280 | * @return string |
| 281 | */ |
| 282 | public function getPrintRateUnit() |
| 283 | { |
| 284 | return $this->getFirstAttribute($this->schema->printerPrintRateUnit()); |
| 285 | } |
| 286 | } |