From: mmn Date: Fri, 20 Nov 2015 17:50:01 +0000 (+0000) Subject: Merge branch 'refactor-file-processNew' into 'nightly' X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b33b40db45a4b6dda32e963518fc6c8abd94c605;p=quix0rs-gnu-social.git Merge branch 'refactor-file-processNew' into 'nightly' Refactor on File::processNew The code was so involved there was even a comment asking for a refactor. Now, File_redirection::where always returns a nice File_redirection object instead of an array or string or nothing. The object is either one which already existed or else a new, unsaved object. Instead of duplicating "does it exist" checks everywhere, do it in File_redirection::where. You either get what exists or something to save. An unsaved File_redirection may be paired with an unsaved File. You will want to save the File first (using ->saveFile()) and put the id in File_redirection#file_id before saving. See merge request !57 --- b33b40db45a4b6dda32e963518fc6c8abd94c605