src/Budkit/Datastore/Model/Entity.php
final public function setListOrderBy($fields, $direction = "ASC")
    {

        $direction = (in_array(strtoupper(trim($direction)), array('ASC', 'DESC'), TRUE)) ? ' ' . $direction : ' ASC';
        $orderby = NULL;
        //Clean up the order by field list
        if (!empty($fields) && !is_array($fields)) {
            $temp = array();
            foreach (explode(',', $fields) as $part) {
                $part = trim($part);
                $temp[] = $part;
            }

            $orderby = implode(', ', $temp);
        } else if (is_array($fields)) {
            $temp = array();
            foreach ($fields as $field) {
                $part = trim($field);
                $temp[] = $part;
            }
            $orderby = implode(', ', $temp);
        }


        if (!empty($orderby)) {
            $this->listOrderByStatement = "\nORDER BY " . $orderby . $direction;
        }
        //Return this object
        return $this;
    }
final public function setListOrderBy($fields, $direction = "ASC")
    {

        $direction = (in_array(strtoupper(trim($direction)), array('ASC', 'DESC'), TRUE)) ? ' ' . $direction : ' ASC';
        $orderby = NULL;
        //Clean up the order by field list
        if (!empty($fields) && !is_array($fields)) {
            $temp = array();
            foreach (explode(',', $fields) as $part) {
                $part = trim($part);
                $temp[] = $part;
            }

            $orderby = implode(', ', $temp);
        } else if (is_array($fields)) {
            $temp = array();
            foreach ($fields as $field) {
                $part = trim($field);
                $temp[] = $part;
            }
            $orderby = implode(', ', $temp);
        }


        if (!empty($orderby)) {
            $this->listOrderByStatement = "\nORDER BY " . $orderby . $direction;
        }
        //Return this object
        return $this;
    }
final public function setListOrderBy ( $ fields , $ direction = "ASC" ) { $ direction = ( in_array ( strtoupper ( trim ( $ direction ) ) , array ( 'ASC' , 'DESC' ) , TRUE ) ) ? ' ' . $ direction : ' ASC' ; $ orderby = NULL ; //Clean up the order by field list if ( ! empty ( $ fields ) && ! is_array ( $ fields ) ) { $ temp = array ( ) ; foreach ( explode ( ',' , $ fields ) as $ part ) { $ part = trim ( $ part ) ; $ temp [ ] = $ part ; } $ orderby = implode ( ', ' , $ temp ) ; } else if ( is_array ( $ fields ) ) { $ temp = array ( ) ; foreach ( $ fields as $ field ) { $ part = trim ( $ field ) ; $ temp [ ] = $ part ; } $ orderby = implode ( ', ' , $ temp ) ; } if ( ! empty ( $ orderby ) ) { $ this -> listOrderByStatement = "\nORDER BY " . $ orderby . $ direction ; } //Return this object return $ this ; }
Sets the list order direction

@param type $fields comma seperated list, or array
@param type $direction
@return \Platform\Entity
Sets the list order direction