public function get_lines_by_site($SITE)
    {
        // Get all the phone object uuid=>names for a given site (based on device pool)
        $PHONES = $this->get_object_type_by_site($SITE, 'Phone');
        $LINES = [];
        // Loop through our phones at a site and use the UUID to get its detailed object information
        foreach ($PHONES as $UUID => $NAME) {
            $PHONE = $this->get_object_type_by_uuid($UUID, 'Phone');
            // if there are lines in the phone go get the uuid and name for each line dirn
            if (isset($PHONE['lines']) && is_array($PHONE['lines']) && count($PHONE['lines'])) {
                // loop through each line on the phone and suck out the uuid and dial pattern
                foreach ($PHONE['lines'] as $PHONELINE) {
                    // If the phone has a dirn element with elements
                    if (isset($PHONELINE['dirn']) && is_array($PHONELINE['dirn']) && count($PHONELINE['dirn'])) {
                        // And the dirn has a uuid and pattern with value
                        if (isset($PHONELINE['dirn']['pattern']) && $PHONELINE['dirn']['pattern'] && isset($PHONELINE['dirn']['uuid']) && $PHONELINE['dirn']['uuid']) {
                            // Save this line to the list of site lines we return
                            $LINES[$PHONELINE['dirn']['uuid']] = $PHONELINE['dirn']['pattern'];
                        }
                    }
                }
            }
        }

        return $LINES;
    }
public function get_lines_by_site($SITE)
    {
        // Get all the phone object uuid=>names for a given site (based on device pool)
        $PHONES = $this->get_object_type_by_site($SITE, 'Phone');
        $LINES = [];
        // Loop through our phones at a site and use the UUID to get its detailed object information
        foreach ($PHONES as $UUID => $NAME) {
            $PHONE = $this->get_object_type_by_uuid($UUID, 'Phone');
            // if there are lines in the phone go get the uuid and name for each line dirn
            if (isset($PHONE['lines']) && is_array($PHONE['lines']) && count($PHONE['lines'])) {
                // loop through each line on the phone and suck out the uuid and dial pattern
                foreach ($PHONE['lines'] as $PHONELINE) {
                    // If the phone has a dirn element with elements
                    if (isset($PHONELINE['dirn']) && is_array($PHONELINE['dirn']) && count($PHONELINE['dirn'])) {
                        // And the dirn has a uuid and pattern with value
                        if (isset($PHONELINE['dirn']['pattern']) && $PHONELINE['dirn']['pattern'] && isset($PHONELINE['dirn']['uuid']) && $PHONELINE['dirn']['uuid']) {
                            // Save this line to the list of site lines we return
                            $LINES[$PHONELINE['dirn']['uuid']] = $PHONELINE['dirn']['pattern'];
                        }
                    }
                }
            }
        }

        return $LINES;
    }
public function get_lines_by_site ( $ SITE ) { // Get all the phone object uuid=>names for a given site (based on device pool) $ PHONES = $ this -> get_object_type_by_site ( $ SITE , 'Phone' ) ; $ LINES = [ ] ; // Loop through our phones at a site and use the UUID to get its detailed object information foreach ( $ PHONES as $ UUID => $ NAME ) { $ PHONE = $ this -> get_object_type_by_uuid ( $ UUID , 'Phone' ) ; // if there are lines in the phone go get the uuid and name for each line dirn if ( isset ( $ PHONE [ 'lines' ] ) && is_array ( $ PHONE [ 'lines' ] ) && count ( $ PHONE [ 'lines' ] ) ) { // loop through each line on the phone and suck out the uuid and dial pattern foreach ( $ PHONE [ 'lines' ] as $ PHONELINE ) { // If the phone has a dirn element with elements if ( isset ( $ PHONELINE [ 'dirn' ] ) && is_array ( $ PHONELINE [ 'dirn' ] ) && count ( $ PHONELINE [ 'dirn' ] ) ) { // And the dirn has a uuid and pattern with value if ( isset ( $ PHONELINE [ 'dirn' ] [ 'pattern' ] ) && $ PHONELINE [ 'dirn' ] [ 'pattern' ] && isset ( $ PHONELINE [ 'dirn' ] [ 'uuid' ] ) && $ PHONELINE [ 'dirn' ] [ 'uuid' ] ) { // Save this line to the list of site lines we return $ LINES [ $ PHONELINE [ 'dirn' ] [ 'uuid' ] ] = $ PHONELINE [ 'dirn' ] [ 'pattern' ] ; } } } } } return $ LINES ; }
This function will need to get every phone in a device pool and then build a list of every LINE that is returned.
This function will need to get every phone in a device pool and then build a list of every LINE that is returned .