app\helpers\categoriesHelper::findfather PHP Method

findfather() public static method

public static findfather ( &$son, $array, $id )
    public static function findfather(&$son, $array, $id)
    {
        foreach ($array as $row) {
            if ($row['id'] == $id) {
                array_unshift($son, $row);
                if ($row['category_id'] !== null) {
                    self::findfather($son, $array, $row['category_id']);
                }
                return;
            }
        }
    }