createLanguageFromCreateStruct() public méthode

Creates a Language from $struct.
public createLanguageFromCreateStruct ( eZ\Publish\SPI\Persistence\Content\Language\CreateStruct $struct ) : eZ\Publish\SPI\Persistence\Content\Language
$struct eZ\Publish\SPI\Persistence\Content\Language\CreateStruct
Résultat eZ\Publish\SPI\Persistence\Content\Language
 /**
  * @covers eZ\Publish\Core\Persistence\Legacy\Content\Language\Mapper::createLanguageFromCreateStruct
  *
  * @return void
  */
 public function testCreateLanguageFromCreateStruct()
 {
     $mapper = new Mapper();
     $createStruct = $this->getCreateStructFixture();
     $result = $mapper->createLanguageFromCreateStruct($createStruct);
     $this->assertStructsEqual($this->getLanguageFixture(), $result, array('languageCode', 'name', 'isEnabled'));
 }
Exemple #2
0
 /**
  * Create a new language.
  *
  * @param \eZ\Publish\SPI\Persistence\Content\Language\CreateStruct $struct
  *
  * @return \eZ\Publish\SPI\Persistence\Content\Language
  */
 public function create(CreateStruct $struct)
 {
     $language = $this->languageMapper->createLanguageFromCreateStruct($struct);
     $language->id = $this->languageGateway->insertLanguage($language);
     return $language;
 }