public function generate_primary_key_statement()
    {

        if (empty($this->primary_key)) return false;

        if (count($this->primary_key) == 1) {
            $this->tpl_replacements['primary_key_assign_statement'] = "'{$this->primary_key[0]}'";
            $this->tpl_replacements['primary_key_if_statement']     = 'empty($this->' . (string)strtolower((string)$this->primary_key[0]) . ')';
            $this->tpl_replacements['primary_key_where_statement']  = ' `' . (string)$this->primary_key[0] . '` = \'{$this->' . (string)strtolower((string)$this->primary_key[0]) . '}\'';
            $this->tpl_replacements['primary_key_method_statement'] = '$' . strtolower((string)$this->primary_key[0]) . " = null";

            return true;
        }

        $this->tpl_replacements['primary_key_assign_statement'] = 'array(';
        foreach ($this->primary_key as $p_key) {
            $this->tpl_replacements['primary_key_assign_statement'] .= "'$p_key',";
            $this->tpl_replacements['primary_key_if_statement'] .= ' || empty($this->' . (string)strtolower((string)$p_key) . ')';
            $this->tpl_replacements['primary_key_where_statement'] .= ' AND `' . (string)$p_key . '` = \'{$this->' . (string)strtolower((string)$p_key) . '}\'';
            $this->tpl_replacements['primary_key_method_statement'] .= '$' . (string)strtolower((string)$p_key) . " = null,";
        }
        $this->tpl_replacements['primary_key_if_statement']     = substr($this->primary_key_if_statement, 4);
        $this->tpl_replacements['primary_key_assign_statement'] = substr($this->primary_key_assign_statement, 0, -1) . ')';
        $this->tpl_replacements['primary_key_method_statement'] = substr($this->primary_key_method_statement, 0, -1);
        $this->tpl_replacements['primary_key_where_statement']  = substr($this->primary_key_where_statement, 5);

        return true;
    }
public function generate_primary_key_statement()
    {

        if (empty($this->primary_key)) return false;

        if (count($this->primary_key) == 1) {
            $this->tpl_replacements['primary_key_assign_statement'] = "'{$this->primary_key[0]}'";
            $this->tpl_replacements['primary_key_if_statement']     = 'empty($this->' . (string)strtolower((string)$this->primary_key[0]) . ')';
            $this->tpl_replacements['primary_key_where_statement']  = ' `' . (string)$this->primary_key[0] . '` = \'{$this->' . (string)strtolower((string)$this->primary_key[0]) . '}\'';
            $this->tpl_replacements['primary_key_method_statement'] = '$' . strtolower((string)$this->primary_key[0]) . " = null";

            return true;
        }

        $this->tpl_replacements['primary_key_assign_statement'] = 'array(';
        foreach ($this->primary_key as $p_key) {
            $this->tpl_replacements['primary_key_assign_statement'] .= "'$p_key',";
            $this->tpl_replacements['primary_key_if_statement'] .= ' || empty($this->' . (string)strtolower((string)$p_key) . ')';
            $this->tpl_replacements['primary_key_where_statement'] .= ' AND `' . (string)$p_key . '` = \'{$this->' . (string)strtolower((string)$p_key) . '}\'';
            $this->tpl_replacements['primary_key_method_statement'] .= '$' . (string)strtolower((string)$p_key) . " = null,";
        }
        $this->tpl_replacements['primary_key_if_statement']     = substr($this->primary_key_if_statement, 4);
        $this->tpl_replacements['primary_key_assign_statement'] = substr($this->primary_key_assign_statement, 0, -1) . ')';
        $this->tpl_replacements['primary_key_method_statement'] = substr($this->primary_key_method_statement, 0, -1);
        $this->tpl_replacements['primary_key_where_statement']  = substr($this->primary_key_where_statement, 5);

        return true;
    }
public function generate_primary_key_statement ( ) { if ( empty ( $ this -> primary_key ) ) return false ; if ( count ( $ this -> primary_key ) == 1 ) { $ this -> tpl_replacements [ 'primary_key_assign_statement' ] = "'{$this->primary_key[0]}'" ; $ this -> tpl_replacements [ 'primary_key_if_statement' ] = 'empty($this->' . ( string ) strtolower ( ( string ) $ this -> primary_key [ 0 ] ) . ')' ; $ this -> tpl_replacements [ 'primary_key_where_statement' ] = ' `' . ( string ) $ this -> primary_key [ 0 ] . '` = \'{$this->' . ( string ) strtolower ( ( string ) $ this -> primary_key [ 0 ] ) . '}\'' ; $ this -> tpl_replacements [ 'primary_key_method_statement' ] = '$' . strtolower ( ( string ) $ this -> primary_key [ 0 ] ) . " = null" ; return true ; } $ this -> tpl_replacements [ 'primary_key_assign_statement' ] = 'array(' ; foreach ( $ this -> primary_key as $ p_key ) { $ this -> tpl_replacements [ 'primary_key_assign_statement' ] .= "'$p_key'," ; $ this -> tpl_replacements [ 'primary_key_if_statement' ] .= ' || empty($this->' . ( string ) strtolower ( ( string ) $ p_key ) . ')' ; $ this -> tpl_replacements [ 'primary_key_where_statement' ] .= ' AND `' . ( string ) $ p_key . '` = \'{$this->' . ( string ) strtolower ( ( string ) $ p_key ) . '}\'' ; $ this -> tpl_replacements [ 'primary_key_method_statement' ] .= '$' . ( string ) strtolower ( ( string ) $ p_key ) . " = null," ; } $ this -> tpl_replacements [ 'primary_key_if_statement' ] = substr ( $ this -> primary_key_if_statement , 4 ) ; $ this -> tpl_replacements [ 'primary_key_assign_statement' ] = substr ( $ this -> primary_key_assign_statement , 0 , - 1 ) . ')' ; $ this -> tpl_replacements [ 'primary_key_method_statement' ] = substr ( $ this -> primary_key_method_statement , 0 , - 1 ) ; $ this -> tpl_replacements [ 'primary_key_where_statement' ] = substr ( $ this -> primary_key_where_statement , 5 ) ; return true ; }
generates the primary key statement

@return bool
generates the primary key statement