function setLeaderLengths($record_length, $base_address)
    {
        if (!is_int($record_length)) {
            return false;
        }
        if (!is_int($base_address)) {
            return false;
        }

        // Set record length
        $this->setLeader(substr_replace($this->getLeader(), sprintf("%05d", $record_length), 0, 5));
        $this->setLeader(substr_replace($this->getLeader(), sprintf("%05d", $base_address), File_MARC::DIRECTORY_ENTRY_LEN, 5));
        $this->setLeader(substr_replace($this->getLeader(), '22', 10, 2));
        $this->setLeader(substr_replace($this->getLeader(), '4500', 20, 4));

        if (strlen($this->getLeader()) > File_MARC::LEADER_LEN) {
            // Avoid incoming leaders that are mangled to be overly long
            $this->setLeader(substr($this->getLeader(), 0, File_MARC::LEADER_LEN));
            $this->addWarning("Input leader was too long; truncated to " . File_MARC::LEADER_LEN . " characters");
        }
        return true;
    }
function setLeaderLengths($record_length, $base_address)
    {
        if (!is_int($record_length)) {
            return false;
        }
        if (!is_int($base_address)) {
            return false;
        }

        // Set record length
        $this->setLeader(substr_replace($this->getLeader(), sprintf("%05d", $record_length), 0, 5));
        $this->setLeader(substr_replace($this->getLeader(), sprintf("%05d", $base_address), File_MARC::DIRECTORY_ENTRY_LEN, 5));
        $this->setLeader(substr_replace($this->getLeader(), '22', 10, 2));
        $this->setLeader(substr_replace($this->getLeader(), '4500', 20, 4));

        if (strlen($this->getLeader()) > File_MARC::LEADER_LEN) {
            // Avoid incoming leaders that are mangled to be overly long
            $this->setLeader(substr($this->getLeader(), 0, File_MARC::LEADER_LEN));
            $this->addWarning("Input leader was too long; truncated to " . File_MARC::LEADER_LEN . " characters");
        }
        return true;
    }
function setLeaderLengths ( $ record_length , $ base_address ) { if ( ! is_int ( $ record_length ) ) { return false ; } if ( ! is_int ( $ base_address ) ) { return false ; } // Set record length $ this -> setLeader ( substr_replace ( $ this -> getLeader ( ) , sprintf ( "%05d" , $ record_length ) , 0 , 5 ) ) ; $ this -> setLeader ( substr_replace ( $ this -> getLeader ( ) , sprintf ( "%05d" , $ base_address ) , File_MARC :: DIRECTORY_ENTRY_LEN , 5 ) ) ; $ this -> setLeader ( substr_replace ( $ this -> getLeader ( ) , '22' , 10 , 2 ) ) ; $ this -> setLeader ( substr_replace ( $ this -> getLeader ( ) , '4500' , 20 , 4 ) ) ; if ( strlen ( $ this -> getLeader ( ) ) > File_MARC :: LEADER_LEN ) { // Avoid incoming leaders that are mangled to be overly long $ this -> setLeader ( substr ( $ this -> getLeader ( ) , 0 , File_MARC :: LEADER_LEN ) ) ; $ this -> addWarning ( "Input leader was too long; truncated to " . File_MARC :: LEADER_LEN . " characters" ) ; } return true ; }
Set MARC record leader lengths

Set the Leader lengths of the record according to defaults specified in
{@link http://www.loc.gov/marc/bibliographic/ecbdldrd.html}

@param int $record_length Record length
@param int $base_address  Base address of data

@return bool              Success or failure
Set MARC record leader lengths