There is in each city and county a planning agency with the powers necessary to carry out the purposes of this title. The legislative body of each city and county shall by ordinance assign the functions of the planning agency to a planning department, one or more planning commissions, administrative bodies or hearing officers, the legislative body itself, or any combination thereof, as it deems appropriate and necessary. In the absence of an assignment, the legislative body shall carry out all the functions of the planning agency.