WordPress.org

Make WordPress Core

Changeset 949 in tests


Ignore:
Timestamp:
08/05/12 22:16:16 (2 years ago)
Author:
nbachiyski
Message:

Rename get() to get_object_by_id()

All the other object manipulation methods have object in its name. Also
it's better for the reader to know we get it by id, otherwise it's too
generic.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/factory.php

    r948 r949  
    3434    } 
    3535 
    36     function get( $post_id ) { 
     36    function get_object_by_id $post_id ) { 
    3737        return get_post( $post_id ); 
    3838    } 
     
    5959    } 
    6060 
    61     function get( $user_id ) { 
     61    function get_object_by_id $user_id ) { 
    6262        return get_user( $user_id ); 
    6363    } 
     
    8989    } 
    9090 
    91     function get( $comment_id ) { 
     91    function get_object_by_id $comment_id ) { 
    9292        return get_comment( $comment_id ); 
    9393    } 
     
    115115    function update_object( $blog_id, $fields ) {} 
    116116 
    117     function get( $blog_id ) { 
     117    function get_object_by_id $blog_id ) { 
    118118        return get_blog_details( $blog_id, false ); 
    119119    } 
     
    154154    } 
    155155 
    156     function get( $term_id ) { 
     156    function get_object_by_id $term_id ) { 
    157157        return get_term( $term_id ); 
    158158    } 
     
    200200    function create_and_get( $args = array(), $generation_definitions = null ) { 
    201201        $object_id = $this->create( $args, $generation_definitions ); 
    202         return $this->get( $object_id ); 
    203     } 
    204  
    205     abstract function get( $object_id ); 
     202        return $this->get_object_by_id( $object_id ); 
     203    } 
     204 
     205    abstract function get_object_by_id $object_id ); 
    206206 
    207207    function create_many( $count, $args = array(), $generation_definitions = null ) { 
Note: See TracChangeset for help on using the changeset viewer.