ClassMetadata.php 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. /*
  3. * Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License");
  6. * you may not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. namespace JMS\DiExtraBundle\Metadata;
  18. use Metadata\ClassMetadata as BaseClassMetadata;
  19. class ClassMetadata extends BaseClassMetadata
  20. {
  21. public $id;
  22. public $parent;
  23. public $scope;
  24. public $public;
  25. public $abstract;
  26. public $tags = array();
  27. public $arguments;
  28. public $methodCalls = array();
  29. public $lookupMethods = array();
  30. public $properties = array();
  31. public $initMethod;
  32. public function serialize()
  33. {
  34. return serialize(array(
  35. $this->id,
  36. $this->parent,
  37. $this->scope,
  38. $this->public,
  39. $this->abstract,
  40. $this->tags,
  41. $this->arguments,
  42. $this->methodCalls,
  43. $this->lookupMethods,
  44. $this->properties,
  45. $this->initMethod,
  46. parent::serialize(),
  47. ));
  48. }
  49. public function unserialize($str)
  50. {
  51. list(
  52. $this->id,
  53. $this->parent,
  54. $this->scope,
  55. $this->public,
  56. $this->abstract,
  57. $this->tags,
  58. $this->arguments,
  59. $this->methodCalls,
  60. $this->lookupMethods,
  61. $this->properties,
  62. $this->initMethod,
  63. $parentStr
  64. ) = unserialize($str);
  65. parent::unserialize($parentStr);
  66. }
  67. }