File indexing completed on 2024-06-16 05:30:27

0001 <?php
0002 
0003 /**
0004  * Zend Framework
0005  *
0006  * LICENSE
0007  *
0008  * This source file is subject to the new BSD license that is bundled
0009  * with this package in the file LICENSE.txt.
0010  * It is also available through the world-wide-web at this URL:
0011  * http://framework.zend.com/license/new-bsd
0012  * If you did not receive a copy of the license and are unable to
0013  * obtain it through the world-wide-web, please send an email
0014  * to license@zend.com so we can send you a copy immediately.
0015  *
0016  * @category   Zend
0017  * @package    Zend_Service
0018  * @subpackage Yahoo
0019  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0020  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0021  * @version    $Id$
0022  */
0023 
0024 
0025 /**
0026  * @category   Zend
0027  * @package    Zend_Service
0028  * @subpackage Yahoo
0029  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0030  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0031  */
0032 class Zend_Service_Yahoo_Image
0033 {
0034     /**
0035      * Image URL
0036      *
0037      * @var string
0038      */
0039     public $Url;
0040 
0041     /**
0042      * Image height in pixels
0043      *
0044      * @var int
0045      */
0046     public $Height;
0047 
0048     /**
0049      * Image width in pixels
0050      *
0051      * @var int
0052      */
0053     public $Width;
0054 
0055 
0056     /**
0057      * Initializes the image
0058      *
0059      * @param  DOMNode $dom
0060      * @param  string  $namespace
0061      * @return void
0062      */
0063     public function __construct(DOMNode $dom, $namespace)
0064     {
0065         $xpath = new DOMXPath($dom->ownerDocument);
0066         $xpath->registerNamespace('yh', $namespace);
0067         $this->Url = Zend_Uri::factory($xpath->query('./yh:Url/text()', $dom)->item(0)->data);
0068         $this->Height = (int) $xpath->query('./yh:Height/text()', $dom)->item(0)->data;
0069         $this->Width = (int) $xpath->query('./yh:Width/text()', $dom)->item(0)->data;
0070     }
0071 }