-
-
Save jpingo/0edf2fc0a89274617e42 to your computer and use it in GitHub Desktop.
Public API Relation Tests
This file contains 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 | |
public function _testTC1231UpdateAnObjectRelationClass__stage3() | |
{ | |
$classUpdate = $this->api->getContentTypeToUpdate( 'a_relation_class' ); | |
// Add new Field definiton. | |
$relAttr = $this->api->newFieldDefinition( 'obj_rel2', 'Object Relation 2', 'ezobjectrelation', 'This is a Object Relation test 2' ); | |
$relAttr->isRequired = true; | |
$relAttr->isSearchable = false; | |
$relAttr->position = 3; | |
$relAttr->fieldSettings = array( | |
'selectionMethod' => 1, | |
'selectionRoot' => '999' | |
); | |
$classUpdate->addField( $relAttr ); | |
$this->api->saveContentTypeUpdate( $classUpdate ); | |
} | |
public function _testTC1487UpdateAnObjectRelationObject__stage2() | |
{ | |
//Update the Oject Retation Object | |
$contentInfo = $this->api->getContentInfoByPath('/Object-Relation-Test'); | |
$folder = $this->api ->getContentInfoByPath('/News'); | |
$content = $this->api->getContentToUpdate( $contentInfo ); | |
$content->setField( 'name', 'Object Relation Test Updated' ); | |
//Set obj_rel to a available location | |
$content->setField( 'obj_rel', '999' ); | |
$this->api->saveContentUpdate( $content ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment