コード例 #1
0
 public function setRelationship_only()
 {
     parent::setRelationship_only();
     $this->one_to_many->setRelationship_only();
 }
コード例 #2
0
 function __construct($definition)
 {
     parent::__construct($definition);
 }
コード例 #3
0
 function addFromPost()
 {
     $definition = array();
     require_once 'modules/ModuleBuilder/parsers/relationships/AbstractRelationship.php';
     foreach (AbstractRelationship::$definitionKeys as $key) {
         if (!empty($_REQUEST[$key])) {
             $definition[$key] = $key == 'relationship_type' ? AbstractRelationship::parseRelationshipType($_REQUEST[$key]) : $_REQUEST[$key];
         }
     }
     // if this is a change to an existing relationship, and it is not readonly, then delete the old one
     if (!empty($_REQUEST['relationship_name'])) {
         if ($relationship = $this->get($_REQUEST['relationship_name'])) {
             unset($definition['relationship_name']);
             // in case the related modules have changed; this name is probably no longer appropriate
             if (!$relationship->readonly()) {
                 $this->delete($_REQUEST['relationship_name']);
             }
         }
     }
     $newRelationship = RelationshipFactory::newRelationship($definition);
     // TODO: error handling in case we get a badly formed definition and hence relationship
     $this->add($newRelationship);
     return $newRelationship;
 }
コード例 #4
0
 public function __construct($options = array())
 {
     parent::__construct($options);
     if (!$this->class_name) {
         $this->set_inferred_class_name();
     }
     //infer from class_name
     if (!$this->foreign_key) {
         $this->foreign_key = array($this->keyify($this->class_name));
     }
     $this->primary_key = array(Table::load($this->class_name)->pk[0]);
 }
コード例 #5
0
 /**
  * @param AbstractRelationship $relationship
  * @return void
  */
 private function removeAppLangStrings($relationship)
 {
     $def = $relationship->getDefinition();
     if (strtolower($def['rhs_module']) == 'activities' && !empty($_REQUEST['view_package']) && !empty($_REQUEST['view_module'])) {
         $mb = new ModuleBuilder();
         $module = $mb->getPackageModule($_REQUEST['view_package'], $_REQUEST['view_module']);
         $appStrings = $module->getAppListStrings();
         foreach (array('parent_type_display', 'record_type_display', 'record_type_display_notes') as $key) {
             if (isset($appStrings[$key][$module->key_name])) {
                 unset($appStrings[$key][$module->key_name]);
             }
         }
         $module->setAppListStrings('en_us', $appStrings);
         $module->save();
     }
 }
コード例 #6
0
 public function __construct($options = array())
 {
     parent::__construct($options);
     if (!$this->class_name) {
         $this->set_inferred_class_name();
     }
     //infer from class_name
     if (!$this->foreign_key) {
         $this->foreign_key = array(Inflector::instance()->keyify($this->class_name));
     }
 }
コード例 #7
0
ファイル: Bug62094Test.php プロジェクト: delkyd/sugarcrm_dev
 public function getLinkFieldDefinition($sourceModule, $relationshipName)
 {
     return parent::getLinkFieldDefinition($sourceModule, $relationshipName);
 }
コード例 #8
0
 public function __construct($options = array())
 {
     parent::__construct($options);
     if (!$this->className) {
         $this->setInferredClassName();
     }
     //infer from class_name
     if (!$this->foreignKey) {
         $this->foreignKey = array(Inflector::instance()->keyify($this->className));
     }
     $this->primaryKey = array(Table::load($this->className)->pk[0]);
 }