PageRenderTime 43ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/extlib/Services/oEmbed/Object/Link.php

https://github.com/Br3nda/laconica
PHP | 73 lines | 10 code | 4 blank | 59 comment | 0 complexity | 1b973927f221811f71383b0f3a23c32e MD5 | raw file
Possible License(s): AGPL-3.0
  1. <?php
  2. /**
  3. * Link object for {@link Services_oEmbed}
  4. *
  5. * PHP version 5.2.0+
  6. *
  7. * Copyright (c) 2008, Digg.com, Inc.
  8. *
  9. * All rights reserved.
  10. *
  11. * Redistribution and use in source and binary forms, with or without
  12. * modification, are permitted provided that the following conditions are met:
  13. *
  14. * - Redistributions of source code must retain the above copyright notice,
  15. * this list of conditions and the following disclaimer.
  16. * - Redistributions in binary form must reproduce the above copyright notice,
  17. * this list of conditions and the following disclaimer in the documentation
  18. * and/or other materials provided with the distribution.
  19. * - Neither the name of Digg.com, Inc. nor the names of its contributors
  20. * may be used to endorse or promote products derived from this software
  21. * without specific prior written permission.
  22. *
  23. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  24. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  25. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  26. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  27. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  28. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  29. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  30. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  31. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  32. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  33. * POSSIBILITY OF SUCH DAMAGE.
  34. *
  35. * @category Services
  36. * @package Services_oEmbed
  37. * @author Joe Stump <joe@joestump.net>
  38. * @copyright 2008 Digg.com, Inc.
  39. * @license http://tinyurl.com/42zef New BSD License
  40. * @version SVN: @version@
  41. * @link http://code.google.com/p/digg
  42. * @link http://oembed.com
  43. */
  44. require_once 'Services/oEmbed/Object/Common.php';
  45. /**
  46. * Link object for {@link Services_oEmbed}
  47. *
  48. * @category Services
  49. * @package Services_oEmbed
  50. * @author Joe Stump <joe@joestump.net>
  51. * @copyright 2008 Digg.com, Inc.
  52. * @license http://tinyurl.com/42zef New BSD License
  53. * @version Release: @version@
  54. * @link http://code.google.com/p/digg
  55. * @link http://oembed.com
  56. */
  57. class Services_oEmbed_Object_Link extends Services_oEmbed_Object_Common
  58. {
  59. /**
  60. * Output a sane link
  61. *
  62. * @return string An HTML link of the object
  63. */
  64. public function __toString()
  65. {
  66. return '<a href="' . $this->url . '">' . $this->title . '</a>';
  67. }
  68. }
  69. ?>