Bravo3\Orm\Enum\RelationshipType::isMultiIndex PHP Method

isMultiIndex() public static method

Check if the given relationship type contains multiple values
public static isMultiIndex ( RelationshipType $relationship_type ) : boolean
$relationship_type RelationshipType
return boolean
    public static function isMultiIndex(RelationshipType $relationship_type)
    {
        return $relationship_type == RelationshipType::ONETOMANY() || $relationship_type == RelationshipType::MANYTOMANY();
    }

Usage Example

コード例 #1
0
ファイル: RelationshipManager.php プロジェクト: bravo3/orm
 /**
  * Get an array containing an array of foreign entities to remove the local entity from, and an array of foreign
  * entities to add the local entity to and an array of entities which remain the same in the relationship
  *
  * @param string          $key          Local relationship key
  * @param Relationship    $relationship Relationship in question
  * @param object|object[] $new_value    New local value containing foreign entities
  * @return array
  */
 private function getRelationshipDeltas($key, Relationship $relationship, $new_value)
 {
     $this->getDriver()->debugLog('Getting inverse relationship deltas: ' . $key);
     if (RelationshipType::isMultiIndex($relationship->getRelationshipType())) {
         return $this->getRelationshipDeltasMulti($key, $new_value);
     } else {
         return $this->getRelationshipDeltasSingle($key, $new_value);
     }
 }
All Usage Examples Of Bravo3\Orm\Enum\RelationshipType::isMultiIndex