/** * Return files by URL. Files will be ordered by filename * * @param ProjectFolder $folder * @param boolean $show_private * @return array */ static function getByFolder(ProjectFolder $folder, $show_private = false) { $project = $folder->getProject(); if (!$project instanceof Project) { return null; } // if if ($show_private) { $conditions = array('`project_id` =? AND `folder_id` = ?', $project->getId(), $folder->getId()); } else { $conditions = array('`project_id` =? AND `folder_id` = ? AND `is_private` = ?', $project->getId(), $folder->getId(), false); } // if return self::findAll(array('conditions' => $conditions, 'order' => '`filename`')); }