Created
June 1, 2012 09:23
-
-
Save dpobel/2850696 to your computer and use it in GitHub Desktop.
Version and language list of a content object
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $object = eZContentObject::fetch( 98 ); | |
| foreach ( $object->attribute( 'versions' ) as $version ) | |
| { | |
| $cli->output( 'Version ' . $version->attribute( 'version' ) ); | |
| $languages = eZContentLanguage::decodeLanguageMask( $version->attribute( 'language_mask' ) ); | |
| $cli->output( 'This version exists in ' . count( $languages['language_list'] ) . ' languages' ); | |
| foreach ( $languages['language_list'] as $languageId ) | |
| { | |
| $language = eZContentLanguage::fetch( $languageId ); | |
| $cli->output( ' - In ' . $language->attribute( 'name' ) ); | |
| $attributes = $version->contentObjectAttributes( $language->attribute( 'locale' ) ); | |
| foreach ( $attributes as $attribute ) | |
| { | |
| $cli->output( ' o ' . $attribute->attribute( 'contentclass_attribute_identifier' ) . ' : ' . $attribute->toString() ); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment