/** * fromReflection() - Build a docblock generator object from a reflection object * * @param ReflectionDocblock $reflectionDocblock * @return DocblockGenerator */ public static function fromReflection(DocBlockReflection $reflectionDocblock) { $docblock = new self(); $docblock->setSourceContent($reflectionDocblock->getContents()); $docblock->setSourceDirty(false); $docblock->setShortDescription($reflectionDocblock->getShortDescription()); $docblock->setLongDescription($reflectionDocblock->getLongDescription()); foreach ($reflectionDocblock->getTags() as $tag) { $docblock->setTag(Docblock\Tag::fromReflection($tag)); } return $docblock; }
/** * fromReflection() - Build a docblock generator object from a reflection object * * @param Zend_Reflection_Docblock $reflectionDocblock * @return Zend_CodeGenerator_Php_Docblock */ public static function fromReflection(Zend_Reflection_Docblock $reflectionDocblock) { $docblock = new self(); $docblock->setSourceContent($reflectionDocblock->getContents()); $docblock->setSourceDirty(false); $docblock->setShortDescription($reflectionDocblock->getShortDescription()); $docblock->setLongDescription($reflectionDocblock->getLongDescription()); foreach ($reflectionDocblock->getTags() as $tag) { $docblock->setTag(Zend_CodeGenerator_Php_Docblock_Tag::fromReflection($tag)); } return $docblock; }
/** * @see CultureFeed_Cdb_IElement::parseFromCdbXml(SimpleXMLElement $xmlElement) * @return CultureFeed_Cdb_List_Item */ public static function parseFromCdbXml(SimpleXMLElement $xmlElement) { $attributes = $xmlElement->attributes(); $item = new self(); // Set ID. $item->setCdbId((string) $attributes['cidn']); if (!empty($attributes['private'])) { $item->setPrivate((bool) $attributes['private']); } if (!empty($attributes['externalid'])) { $item->setExternalId((string) $attributes['externalid']); } $item->setTitle((string) $attributes['title']); if (!empty($attributes['shortdescription'])) { $item->setShortDescription((string) $attributes['shortdescription']); } if (!empty($attributes['thumbnail'])) { $item->setThumbnail((string) $attributes['thumbnail']); } if (!empty($attributes['address'])) { $item->setAddress((string) $attributes['address']); } if (!empty($attributes['city'])) { $item->setCity((string) $attributes['city']); } if (!empty($attributes['zip'])) { $item->setZip((string) $attributes['zip']); } if (!empty($attributes['latlng'])) { $item->setCoordinates((string) $attributes['latlng']); } if (!empty($attributes['location'])) { $item->setLocation((string) $attributes['location']); } if (!empty($attributes['locationid'])) { $item->setLocationId((string) $attributes['locationid']); } if (!empty($attributes['calendarsummary'])) { $item->setCalendarSummary((string) $attributes['calendarsummary']); } if (!empty($attributes['itemtype'])) { $item->setType((string) $attributes['itemtype']); } if (!empty($attributes['price'])) { $item->setPrice((string) $attributes['price']); } if (!empty($attributes['pricedescription'])) { $item->setPriceDescription((string) $attributes['pricedescription']); } if (!empty($attributes['agefrom'])) { $item->setAgeFrom((string) $attributes['agefrom']); } if (!empty($attributes['performers'])) { $item->setPerformers((string) $attributes['performers']); } return $item; }
/** * @see CultureFeed_Cdb_IElement::parseFromCdbXml(SimpleXMLElement $xmlElement) * @return self */ public static function parseFromCdbXml(SimpleXMLElement $xmlElement) { if (empty($xmlElement->title)) { throw new CultureFeed_Cdb_ParseException("Title missing for actordetail element"); } $attributes = $xmlElement->attributes(); if (empty($attributes['lang'])) { throw new CultureFeed_Cdb_ParseException("Lang missing for actordetail element"); } $actorDetail = new self(); $actorDetail->setTitle((string) $xmlElement->title); $actorDetail->setLanguage((string) $attributes['lang']); if (!empty($xmlElement->calendarsummary)) { $actorDetail->setCalendarSummary((string) $xmlElement->calendarsummary); } if (!empty($xmlElement->shortdescription)) { $actorDetail->setShortDescription((string) $xmlElement->shortdescription); } if (!empty($xmlElement->longdescription)) { $actorDetail->setLongDescription((string) $xmlElement->longdescription); } if (!empty($xmlElement->media->file)) { foreach ($xmlElement->media->file as $fileElement) { $actorDetail->media->add(CultureFeed_Cdb_Data_File::parseFromCdbXML($fileElement)); } } return $actorDetail; }