private function checkAndAssignClassName($objects)
    {
        foreach ($objects as $object)
        {
            if ($this->targetClassName === null)
            {
                $this->targetClassName = $object->getClassName();
            }
            if ($this->targetClassName != $object->getClassName())
            {
                throw new \Exception('All objects in a relation must be of the same class.');
            }
        }
    }
private function checkAndAssignClassName($objects)
    {
        foreach ($objects as $object)
        {
            if ($this->targetClassName === null)
            {
                $this->targetClassName = $object->getClassName();
            }
            if ($this->targetClassName != $object->getClassName())
            {
                throw new \Exception('All objects in a relation must be of the same class.');
            }
        }
    }
private function checkAndAssignClassName ( $ objects ) { foreach ( $ objects as $ object ) { if ( $ this -> targetClassName === null ) { $ this -> targetClassName = $ object -> getClassName ( ) ; } if ( $ this -> targetClassName != $ object -> getClassName ( ) ) { throw new \ Exception ( 'All objects in a relation must be of the same class.' ) ; } } }
Helper function to check that all passed AVObjects have same class name
and assign targetClassName variable.

@param array $objects AVObject array.

@throws \Exception
Helper function to check that all passed AVObjects have same class name and assign targetClassName variable .