MetaSubtitle::same_as PHP Method

same_as() public method

Returns true if the current object is the same type as the given object then has the same value.
public same_as ( mix $p_otherObject ) : boolean
$p_otherObject mix
return boolean
    public function same_as($p_otherObject)
    {
        return get_class($this) == get_class($p_otherObject) && $this->m_number == $p_otherObject->m_number && $this->m_fieldName == $p_otherObject->m_fieldName && $this->m_name == $p_otherObject->m_name;
    }

Usage Example

示例#1
0
 private function setSubtitleHandler(MetaSubtitle $p_oldSubtitle, MetaSubtitle $p_newSubtitle)
 {
     if (!$p_oldSubtitle->same_as($p_newSubtitle)) {
         $this->m_objects['subtitle'] = $p_newSubtitle;
     }
 }